diff options
Diffstat (limited to 'plugins/kv/storage.go')
-rw-r--r-- | plugins/kv/storage.go | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/kv/storage.go b/plugins/kv/storage.go index 42e0ef3e..9f460073 100644 --- a/plugins/kv/storage.go +++ b/plugins/kv/storage.go @@ -135,19 +135,20 @@ func (p *Plugin) Serve() chan error { // save the storage p.storages[k] = storage - case redis: - // if _, ok := p.drivers[redis]; !ok { - // continue - // } - // storage, err := p.drivers[redis].Configure(configKey) - // if err != nil { - // errCh <- errors.E(op, err) - // return errCh - // } - // - // // save the storage - // p.storages[k] = storage + if _, ok := p.drivers[redis]; !ok { + continue + } + + storage, err := p.drivers[redis].Provide(configKey) + if err != nil { + errCh <- errors.E(op, err) + return errCh + } + + // save the storage + p.storages[k] = storage + default: errCh <- errors.E(op, errors.Errorf("unknown storage %s", v.(map[string]interface{})[driver])) } |