diff options
author | Valery Piashchynski <[email protected]> | 2021-09-10 19:05:37 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-09-10 19:05:37 +0300 |
commit | e94a80d4586d5a5fedc2edab850c5c8bad93395f (patch) | |
tree | 4272054647725274abb5ee69e355c1e4262760ea /plugins/redis/pubsub/pubsub.go | |
parent | 8fa86886bd5b3c12cf161fb2c1cdd9a2cd53d1bf (diff) |
fix issue with incorrectly parsing local and global configuration
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/redis/pubsub/pubsub.go')
-rw-r--r-- | plugins/redis/pubsub/pubsub.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/redis/pubsub/pubsub.go b/plugins/redis/pubsub/pubsub.go index c9ad3d58..3561ef18 100644 --- a/plugins/redis/pubsub/pubsub.go +++ b/plugins/redis/pubsub/pubsub.go @@ -13,7 +13,7 @@ import ( type PubSubDriver struct { sync.RWMutex - cfg *Config `mapstructure:"redis"` + cfg *Config log logger.Logger channel *redisChannel @@ -34,6 +34,10 @@ func NewPubSubDriver(log logger.Logger, key string, cfgPlugin config.Configurer, return nil, errors.E(op, err) } + if ps.cfg == nil { + return nil, errors.E(op, errors.Errorf("config not found by provided key: %s", key)) + } + ps.cfg.InitDefaults() ps.universalClient = redis.NewUniversalClient(&redis.UniversalOptions{ |