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

Merge pull request #627 from wtfutil/20190910-catch-watcher-error

Don't die if the watcher can't find the file. Continue trying
This commit is contained in:
Chris Cummer 2019-09-11 10:42:28 -07:00 committed by GitHub
commit c83618143e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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