chore: 重构

This commit is contained in:
CalciumIon
2024-06-27 19:30:17 +08:00
parent 402a415c79
commit d767ae04ff
13 changed files with 68 additions and 58 deletions

7
constant/env.go Normal file
View File

@@ -0,0 +1,7 @@
package constant
import (
"one-api/common"
)
var StreamingTimeout = common.GetEnvOrDefault("STREAMING_TIMEOUT", 30)

View File

@@ -1,13 +1,9 @@
package constant
import "one-api/common"
var ServerAddress = "http://localhost:3000"
var WorkerUrl = ""
var WorkerValidKey = ""
var StreamingTimeout = common.GetOrDefault("STREAMING_TIMEOUT", 30)
func EnableWorker() bool {
return WorkerUrl != ""
}