feat: now slave server can sync options with master server (close #88)

This commit is contained in:
JustSong
2023-05-18 12:48:20 +08:00
parent 3c6834a79c
commit 2d39a135f2
3 changed files with 39 additions and 8 deletions

View File

@@ -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()