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:
parent
5eb7763052
commit
14c42f6e6d
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue