diff options
author | Valery Piashchynski <[email protected]> | 2021-09-01 13:19:09 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-09-01 13:19:09 +0300 |
commit | 9c8da162b3347b632f33f85d56e8c1ff7014631a (patch) | |
tree | bb614a186e05adf816b3f2b62e2d25bfa821a574 /plugins/boltdb/boltkv | |
parent | 0437d1f58514f694ea86e8176e621c009cd510f9 (diff) |
Code polishing before release
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/boltdb/boltkv')
-rw-r--r-- | plugins/boltdb/boltkv/driver.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/boltdb/boltkv/driver.go b/plugins/boltdb/boltkv/driver.go index ba1450cd..656d572e 100644 --- a/plugins/boltdb/boltkv/driver.go +++ b/plugins/boltdb/boltkv/driver.go @@ -38,7 +38,7 @@ type Driver struct { stop chan struct{} } -func NewBoltDBDriver(log logger.Logger, key string, cfgPlugin config.Configurer, stop chan struct{}) (*Driver, error) { +func NewBoltDBDriver(log logger.Logger, key string, cfgPlugin config.Configurer) (*Driver, error) { const op = errors.Op("new_boltdb_driver") if !cfgPlugin.Has(RootPluginName) { @@ -47,7 +47,7 @@ func NewBoltDBDriver(log logger.Logger, key string, cfgPlugin config.Configurer, d := &Driver{ log: log, - stop: stop, + stop: make(chan struct{}), } err := cfgPlugin.UnmarshalKey(key, &d.cfg) @@ -411,6 +411,10 @@ func (d *Driver) Clear() error { return nil } +func (d *Driver) Stop() { + d.stop <- struct{}{} +} + // ========================= PRIVATE ================================= func (d *Driver) startGCLoop() { //nolint:gocognit |