Skip to content

Commit

Permalink
fixes occasional json error when reloading settings
Browse files Browse the repository at this point in the history
  • Loading branch information
get-got committed Dec 20, 2020
1 parent f49b0d3 commit fc5d33d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ func main() {
if event.Op&fsnotify.Write == fsnotify.Write {
// It double-fires the event without time check, might depend on OS but this works anyways
if time.Now().Sub(configReloadLastTime).Milliseconds() > 1 {
time.Sleep(1 * time.Second)
log.Println(color.YellowString("Detected changes in \"%s\", reloading settings...", configPath))
loadConfig()
log.Println(color.HiYellowString("Settings reloaded, bound to %d channel(s)", getBoundChannelsCount()))
Expand Down

0 comments on commit fc5d33d

Please sign in to comment.