mirror of
https://github.com/snowykami/server-status-server.git
synced 2025-09-06 03:56:26 +00:00
✨ [web] 新增超时参数并移除不再使用的超时处理接口
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user