diff options
Diffstat (limited to 'plugins/kv/memcached/plugin.go')
-rw-r--r-- | plugins/kv/memcached/plugin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/kv/memcached/plugin.go b/plugins/kv/memcached/plugin.go index e8b05567..181b8a49 100644 --- a/plugins/kv/memcached/plugin.go +++ b/plugins/kv/memcached/plugin.go @@ -36,12 +36,16 @@ func NewMemcachedClient(url string) kv.Storage { func (s *Plugin) Init(log logger.Logger, cfg config.Configurer) error { const op = errors.Op("memcached_plugin_init") - s.cfg = &Config{} - s.cfg.InitDefaults() + if !cfg.Has(PluginName) { + return errors.E(op, errors.Disabled) + } err := cfg.UnmarshalKey(PluginName, &s.cfg) if err != nil { return errors.E(op, err) } + + s.cfg.InitDefaults() + s.log = log return nil } |