diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-07 21:19:38 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 79e59d5460d838203bc79ac86c0ba529305ba2a9 (patch) | |
tree | 7a7d6c48440f02945599606494ac64424d274f58 /pkg/gui/file_watching.go | |
parent | ba4c3e5bc475a7819fd954985105073ba239bf9e (diff) |
add some safe goroutines
WIP
Diffstat (limited to 'pkg/gui/file_watching.go')
-rw-r--r-- | pkg/gui/file_watching.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/gui/file_watching.go b/pkg/gui/file_watching.go index 09b994a14..41f1ff837 100644 --- a/pkg/gui/file_watching.go +++ b/pkg/gui/file_watching.go @@ -6,6 +6,7 @@ import ( "github.com/fsnotify/fsnotify" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" "github.com/sirupsen/logrus" ) @@ -120,7 +121,7 @@ func (gui *Gui) watchFilesForChanges() { if gui.fileWatcher.Disabled { return } - go func() { + go utils.Safe(func() { for { select { // watch for events @@ -141,5 +142,5 @@ func (gui *Gui) watchFilesForChanges() { } } } - }() + }) } |