1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Don't die if the watcher can't find the file. Continue trying

This commit is contained in:
Chris Cummer 2019-09-10 21:43:52 -07:00
parent 33ea383046
commit 79bc78a5f7

View File

@ -141,10 +141,14 @@ func (wtfApp *WtfApp) watchForConfigChanges() {
wtfApp.Stop()
config := cfg.LoadWtfConfigFile(wtfApp.configFilePath, wtfApp.isCustomConfig)
newApp := NewWtfApp(wtfApp.app, config, wtfApp.configFilePath, wtfApp.isCustomConfig)
newApp.Start()
case err := <-watch.Error:
if err == watcher.ErrWatchedFileDeleted {
// Usually happens because the watcher looks for the file as the OS is updating it
continue
}
log.Fatalln(err)
case <-watch.Closed:
return