diff options
author | Valery Piashchynski <[email protected]> | 2021-04-23 00:38:37 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-04-23 00:38:37 +0300 |
commit | 6c55cb6e2d554dfbffe1ce2eedaad3d34202e1bd (patch) | |
tree | ddd08397c74cfc6120e6174864a7a3ef7ca38771 /plugins/kv/storage.go | |
parent | 06ee748c1ca23bf489ae707041f0e8f3e67fbaf7 (diff) |
- Update arch drawio file
- Update comments
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/kv/storage.go')
-rw-r--r-- | plugins/kv/storage.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/kv/storage.go b/plugins/kv/storage.go index 9f460073..a9530f56 100644 --- a/plugins/kv/storage.go +++ b/plugins/kv/storage.go @@ -60,9 +60,6 @@ func (p *Plugin) Serve() chan error { for the boltdb and memcached We should provide here the actual configs for the all requested storages kv: - default: - driver: memory - boltdb-south: driver: boltdb dir: "tests/rr-bolt" @@ -90,8 +87,10 @@ func (p *Plugin) Serve() chan error { for k, v := range p.cfg.Data { if _, ok := v.(map[string]interface{})[driver]; !ok { errCh <- errors.E(op, errors.Errorf("could not find mandatory driver field in the %s storage", k)) + return errCh } + // config key for the particular sub-driver configKey := fmt.Sprintf("%s.%s", PluginName, k) // at this point we know, that driver field present in the cofiguration switch v.(map[string]interface{})[driver] { @@ -150,7 +149,7 @@ func (p *Plugin) Serve() chan error { p.storages[k] = storage default: - errCh <- errors.E(op, errors.Errorf("unknown storage %s", v.(map[string]interface{})[driver])) + p.log.Error("unknown storage", errors.E(op, errors.Errorf("unknown storage %s", v.(map[string]interface{})[driver]))) } } |