1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00

Fix #212: Stale endpoint on dashboard after config change

This commit is contained in:
TwiN 2021-12-03 18:20:09 -05:00
parent 5eb7763052
commit 14c42f6e6d

View file

@ -88,6 +88,8 @@ func listenToConfigurationFileChanges(cfg *config.Config) {
time.Sleep(30 * time.Second) time.Sleep(30 * time.Second)
if cfg.HasLoadedConfigurationFileBeenModified() { if cfg.HasLoadedConfigurationFileBeenModified() {
log.Println("[main][listenToConfigurationFileChanges] Configuration file has been modified") log.Println("[main][listenToConfigurationFileChanges] Configuration file has been modified")
stop()
time.Sleep(time.Second) // Wait a bit to make sure everything is done.
save() save()
updatedConfig, err := loadConfiguration() updatedConfig, err := loadConfiguration()
if err != nil { if err != nil {
@ -101,7 +103,7 @@ func listenToConfigurationFileChanges(cfg *config.Config) {
panic(err) panic(err)
} }
} }
stop() initializeStorage(updatedConfig)
start(updatedConfig) start(updatedConfig)
return return
} }