From 79bc78a5f77b9e687d212623d91964143d12bc4d Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 10 Sep 2019 21:43:52 -0700 Subject: [PATCH] Don't die if the watcher can't find the file. Continue trying --- app/wtf_app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/wtf_app.go b/app/wtf_app.go index f666cb24..22446b77 100644 --- a/app/wtf_app.go +++ b/app/wtf_app.go @@ -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