mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
feat: now slave server can sync options with master server (close #88)
This commit is contained in:
7
main.go
7
main.go
@@ -47,6 +47,13 @@ func main() {
|
||||
|
||||
// Initialize options
|
||||
model.InitOptionMap()
|
||||
if os.Getenv("SYNC_FREQUENCY") != "" {
|
||||
frequency, err := strconv.Atoi(os.Getenv("SYNC_FREQUENCY"))
|
||||
if err != nil {
|
||||
common.FatalLog(err)
|
||||
}
|
||||
go model.SyncOptions(frequency)
|
||||
}
|
||||
|
||||
// Initialize HTTP server
|
||||
server := gin.Default()
|
||||
|
Reference in New Issue
Block a user