You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/watch/watcher_naive.go
+17-46Lines changed: 17 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,29 @@
1
+
// +build !darwin
2
+
1
3
package watch
2
4
3
5
import (
4
-
"io/ioutil"
5
6
"log"
6
7
"os"
7
8
"path/filepath"
8
-
"strconv"
9
-
"strings"
10
9
11
10
"github.com/pkg/errors"
12
11
"github.com/windmilleng/fsnotify"
13
-
"google.golang.org/grpc"
14
-
"google.golang.org/grpc/codes"
15
12
)
16
13
17
-
constenospc="no space left on device"
18
-
constinotifyErrMsg="The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl. See here for more information: https://facebook.github.io/watchman/docs/install.html#linux-inotify-limits"
19
-
constinotifyMin=8192
20
-
21
-
typelinuxNotifystruct {
14
+
// A naive file watcher that uses the plain fsnotify API.
15
+
// Used on all non-Darwin systems (including Windows & Linux).
16
+
//
17
+
// All OS-specific codepaths are handled by fsnotify.
i, err:=strconv.Atoi(strings.TrimSpace(string(data)))
183
-
iferr!=nil {
184
-
returnerr
185
-
}
186
-
187
-
ifi<inotifyMin {
188
-
returngrpc.Errorf(
189
-
codes.ResourceExhausted,
190
-
"The user limit on the total number of inotify watches is too low (%d); increase the fs.inotify.max_user_watches sysctl. See here for more information: https://facebook.github.io/watchman/docs/install.html#linux-inotify-limits",
0 commit comments