summaryrefslogtreecommitdiffstats
path: root/pkg/gui/file_watching.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-07 21:19:38 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commit79e59d5460d838203bc79ac86c0ba529305ba2a9 (patch)
tree7a7d6c48440f02945599606494ac64424d274f58 /pkg/gui/file_watching.go
parentba4c3e5bc475a7819fd954985105073ba239bf9e (diff)
add some safe goroutines
WIP
Diffstat (limited to 'pkg/gui/file_watching.go')
-rw-r--r--pkg/gui/file_watching.go5
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() {
}
}
}
- }()
+ })
}