summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-01-08 21:02:01 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-01-08 21:34:02 +1100
commit1ce5c69cd2ece7bb306f1340df3eac20bd74070e (patch)
tree5cd32b77141b2f570f8d980768d6dcfde8746f6b /pkg/gui/gui.go
parent205d731d7be974abcece5e02cc351bd26101168c (diff)
improve file watching
By default, macs have 256 open files allowed by a given process. This sucks when you end up with over 256 files modified in a repo because after you've watched all of them, lots of other calls to the command line will fail due to violating the limit. Given there's no easy platform agnostic way to see what you've got configured for how many files a process can have open, I'm going to arbitrarily set the max to 200 and when we hit the limit we start unwatching older files to make way for new ones. WIP
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index fc24bbd6b..530c00383 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -15,7 +15,6 @@ import (
"strings"
"time"
- "github.com/fsnotify/fsnotify"
"github.com/go-errors/errors"
// "strings"
@@ -82,7 +81,7 @@ type Gui struct {
statusManager *statusManager
credentials credentials
waitForIntro sync.WaitGroup
- fileWatcher *fsnotify.Watcher
+ fileWatcher *fileWatcher
}
// for now the staging panel state, unlike the other panel states, is going to be
@@ -840,7 +839,7 @@ func (gui *Gui) RunWithSubprocesses() error {
}
}
- gui.fileWatcher.Close()
+ gui.fileWatcher.Watcher.Close()
break
} else if err == gui.Errors.ErrSwitchRepo {