mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 16:13:56 +00:00
fix: disable redis on master node
This commit is contained in:
@@ -17,6 +17,11 @@ func InitRedisClient() (err error) {
|
|||||||
SysLog("REDIS_CONN_STRING not set, Redis is not enabled")
|
SysLog("REDIS_CONN_STRING not set, Redis is not enabled")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if IsMasterNode {
|
||||||
|
SysLog("Redis is disabled on master node")
|
||||||
|
RedisEnabled = false
|
||||||
|
return nil
|
||||||
|
}
|
||||||
SysLog("Redis is enabled")
|
SysLog("Redis is enabled")
|
||||||
opt, err := redis.ParseURL(os.Getenv("REDIS_CONN_STRING"))
|
opt, err := redis.ParseURL(os.Getenv("REDIS_CONN_STRING"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user