Przeglądaj źródła

feat: 开启redis的情况下设置SYNC_FREQUENCY默认为60

CaIon 1 rok temu
rodzic
commit
786ccc7da0
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      common/redis.go

+ 2 - 3
common/redis.go

@@ -18,9 +18,8 @@ func InitRedisClient() (err error) {
 		return nil
 		return nil
 	}
 	}
 	if os.Getenv("SYNC_FREQUENCY") == "" {
 	if os.Getenv("SYNC_FREQUENCY") == "" {
-		RedisEnabled = false
-		SysLog("SYNC_FREQUENCY not set, Redis is disabled")
-		return nil
+		SysLog("SYNC_FREQUENCY not set, use default value 60")
+		SyncFrequency = 60
 	}
 	}
 	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"))