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 575b66c51b
commit 44b9d7a134
3 changed files with 39 additions and 8 deletions
+7
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()