mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
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
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user