[web] 新增超时参数并移除不再使用的超时处理接口

This commit is contained in:
2025-01-03 20:57:36 +08:00
parent 682679b63a
commit ed99ffc938
3 changed files with 16 additions and 11 deletions

View File

@ -1,13 +1,16 @@
package service
import (
"os"
"strconv"
"github.com/LiteyukiStudio/go-logger/log"
"github.com/joho/godotenv"
"os"
)
var (
Token = "server-status-be-q2dw9adh8"
Token = "server-status-be-q2dw9adh8"
Timeout = 30
)
func init() {
@ -15,9 +18,14 @@ func init() {
if err != nil {
log.Info("Error loading .env file")
}
token := os.Getenv("TOKEN")
if token != "" {
Token = token
}
log.Info("Token: ", Token)
if timeout, err := strconv.Atoi(os.Getenv("TIMEOUT")); err == nil {
Timeout = timeout
}
}