Option to disable image proxy checker

This commit is contained in:
VnPower
2024-08-24 09:00:14 +07:00
parent b415ff5e55
commit a530ea0cda
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -108,6 +108,7 @@ var EnvList []*EnvVar = []*EnvVar{
// **Required**: No
//
// The interval in minutes between proxy checks. Defaults to 480 minutes (8 hours) if not set.
// You can disable this by setting the value to 0. Then, proxies will only be checked once at server initialization.
},
}
+6 -1
View File
@@ -34,7 +34,12 @@ func StartProxyChecker() {
return
default:
checkProxies()
time.Sleep(GlobalServerConfig.ProxyCheckInterval)
if t := GlobalServerConfig.ProxyCheckInterval; t > 0 {
time.Sleep(t)
} else {
log.Println("Proxy check interval set to 0, disabling auto-check from now on.")
select {} // Sweet dreams!
}
}
}
}()