diff --git a/controller/channel-test.go b/controller/channel-test.go index 009219a7..efc8cd96 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -354,6 +354,10 @@ func TestAllChannels(c *gin.Context) { } func AutomaticallyTestChannels(frequency int) { + if frequency <= 0 { + common.SysLog("CHANNEL_TEST_FREQUENCY is not set or invalid, skipping automatic channel test") + return + } for { time.Sleep(time.Duration(frequency) * time.Minute) common.SysLog("testing all channels") diff --git a/main.go b/main.go index ca3da601..996b65b3 100644 --- a/main.go +++ b/main.go @@ -168,11 +168,11 @@ func InitResources() error { common.SysLog("No .env file found, using default environment variables. If needed, please create a .env file and set the relevant variables.") } + common.SetupLogger() + // 加载环境变量 common.InitEnv() - common.SetupLogger() - // Initialize model settings ratio_setting.InitRatioSettings()