Add configurable Redis connection retries and following of cluster redirections (#2045)

Closes #1969
This commit is contained in:
Martin Angers
2021-09-15 08:50:32 -04:00
committed by GitHub
parent 404ae820c9
commit 1fa5ce16b8
12 changed files with 386 additions and 66 deletions
+10 -10
View File
@@ -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,