Add configurable Redis connection retries and following of cluster redirections (#2045)
Closes #1969
This commit is contained in:
+10
-10
@@ -200,21 +200,21 @@ the way that the Fleet server works.
|
||||
}
|
||||
}
|
||||
|
||||
redisPool, err := redis.NewRedisPool(
|
||||
config.Redis.Address,
|
||||
config.Redis.Password,
|
||||
config.Redis.Database,
|
||||
config.Redis.UseTLS,
|
||||
config.Redis.ConnectTimeout,
|
||||
config.Redis.KeepAlive,
|
||||
)
|
||||
redisPool, err := redis.NewRedisPool(redis.PoolConfig{
|
||||
Server: config.Redis.Address,
|
||||
Password: config.Redis.Password,
|
||||
Database: config.Redis.Database,
|
||||
UseTLS: config.Redis.UseTLS,
|
||||
ConnTimeout: config.Redis.ConnectTimeout,
|
||||
KeepAlive: config.Redis.KeepAlive,
|
||||
ConnectRetryAttempts: config.Redis.ConnectRetryAttempts,
|
||||
ClusterFollowRedirections: config.Redis.ClusterFollowRedirections,
|
||||
})
|
||||
if err != nil {
|
||||
initFatal(err, "initialize Redis")
|
||||
}
|
||||
resultStore := pubsub.NewRedisQueryResults(redisPool, config.Redis.DuplicateResults)
|
||||
liveQueryStore := live_query.NewRedisLiveQuery(redisPool)
|
||||
// TODO: should that only be done when a certain "migrate" flag is set,
|
||||
// to prevent affecting every startup?
|
||||
if err := liveQueryStore.MigrateKeys(); err != nil {
|
||||
level.Info(logger).Log(
|
||||
"err", err,
|
||||
|
||||
Reference in New Issue
Block a user