mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 16:13:56 +00:00
refactor: refactor relay part (#957)
* refactor: refactor relay part * refactor: refactor config part
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"one-api/common/config"
|
||||
"one-api/common/logger"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
@@ -37,9 +39,9 @@ func init() {
|
||||
|
||||
if os.Getenv("SESSION_SECRET") != "" {
|
||||
if os.Getenv("SESSION_SECRET") == "random_string" {
|
||||
SysError("SESSION_SECRET is set to an example value, please change it to a random string.")
|
||||
logger.SysError("SESSION_SECRET is set to an example value, please change it to a random string.")
|
||||
} else {
|
||||
SessionSecret = os.Getenv("SESSION_SECRET")
|
||||
config.SessionSecret = os.Getenv("SESSION_SECRET")
|
||||
}
|
||||
}
|
||||
if os.Getenv("SQLITE_PATH") != "" {
|
||||
@@ -57,5 +59,6 @@ func init() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
logger.LogDir = *LogDir
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user