fix: disable redis on master node

This commit is contained in:
JustSong 2023-06-22 20:12:33 +08:00
parent b244b3250d
commit 5c118a83f7

View File

@ -17,6 +17,11 @@ func InitRedisClient() (err error) {
SysLog("REDIS_CONN_STRING not set, Redis is not enabled")
return nil
}
if IsMasterNode {
SysLog("Redis is disabled on master node")
RedisEnabled = false
return nil
}
SysLog("Redis is enabled")
opt, err := redis.ParseURL(os.Getenv("REDIS_CONN_STRING"))
if err != nil {