summaryrefslogtreecommitdiff
path: root/plugins/kv/memory/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kv/memory/plugin.go')
-rw-r--r--plugins/kv/memory/plugin.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/kv/memory/plugin.go b/plugins/kv/memory/plugin.go
index ddcf88a9..4201a1c0 100644
--- a/plugins/kv/memory/plugin.go
+++ b/plugins/kv/memory/plugin.go
@@ -25,13 +25,15 @@ type Plugin struct {
func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
const op = errors.Op("in_memory_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
s.stop = make(chan struct{}, 1)