2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

(cli:fix) Read --cluster flag from config file

This commit is contained in:
Ken Hibino 2022-12-18 20:27:02 -08:00
parent c08f142b56
commit 0b8cfad703

View File

@ -351,7 +351,7 @@ func initConfig() {
// createRDB creates a RDB instance using flag values and returns it.
func createRDB() *rdb.RDB {
var c redis.UniversalClient
if useRedisCluster {
if viper.GetBool("cluster") {
addrs := strings.Split(viper.GetString("cluster_addrs"), ",")
c = redis.NewClusterClient(&redis.ClusterOptions{
Addrs: addrs,
@ -375,7 +375,7 @@ func createInspector() *asynq.Inspector {
}
func getRedisConnOpt() asynq.RedisConnOpt {
if useRedisCluster {
if viper.GetBool("cluster") {
addrs := strings.Split(viper.GetString("cluster_addrs"), ",")
return asynq.RedisClusterClientOpt{
Addrs: addrs,