config.Redis#NewClient(): work-around go-redis/redis#1737

... by re-trying once more often than there are connections in the pool.
This commit is contained in:
Alexander A. Klimov 2021-04-27 12:27:48 +02:00
parent 45b626c914
commit 3e45567368

View file

@ -33,6 +33,10 @@ func (r *Redis) NewClient(logger *zap.SugaredLogger) (*icingaredis.Client, error
ReadTimeout: r.Timeout,
})
opts := c.Options()
opts.MaxRetries = opts.PoolSize + 1 // https://github.com/go-redis/redis/issues/1737
c = redis.NewClient(opts)
return icingaredis.NewClient(c, logger, &r.Options), nil
}