summaryrefslogtreecommitdiff
path: root/plugins/redis/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/redis/plugin.go')
-rw-r--r--plugins/redis/plugin.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/redis/plugin.go b/plugins/redis/plugin.go
index 06158b43..204abd17 100644
--- a/plugins/redis/plugin.go
+++ b/plugins/redis/plugin.go
@@ -24,14 +24,17 @@ func (s *Plugin) GetClient() redis.UniversalClient {
func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error {
const op = errors.Op("redis_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, errors.Disabled, err)
}
+ s.cfg.InitDefaults()
s.log = log
s.universalClient = redis.NewUniversalClient(&redis.UniversalOptions{