grepmax 0.7.41 → 0.7.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,17 +89,15 @@ function startWatcher(opts) {
|
|
|
89
89
|
let currentBatchAc = null;
|
|
90
90
|
let summarizationAc = null;
|
|
91
91
|
const MAX_RETRIES = 5;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
usePolling: true,
|
|
100
|
-
|
|
101
|
-
binaryInterval: 10000,
|
|
102
|
-
});
|
|
92
|
+
// macOS: FSEvents is a single-FD kernel API — no EMFILE risk and no polling.
|
|
93
|
+
// Linux: inotify is event-driven but uses one FD per watch; fall back to
|
|
94
|
+
// polling for monorepos to avoid hitting ulimit.
|
|
95
|
+
// Override with GMAX_WATCH_POLL=1 to force polling on any platform.
|
|
96
|
+
const forcePoll = process.env.GMAX_WATCH_POLL === "1";
|
|
97
|
+
const usePoll = forcePoll || process.platform !== "darwin";
|
|
98
|
+
const watcher = (0, chokidar_1.watch)(projectRoot, Object.assign({ ignored: exports.WATCHER_IGNORE_PATTERNS, ignoreInitial: true, persistent: true }, (usePoll
|
|
99
|
+
? { usePolling: true, interval: 5000, binaryInterval: 10000 }
|
|
100
|
+
: {})));
|
|
103
101
|
watcher.on("error", (err) => {
|
|
104
102
|
console.error(`[${wtag}] Watcher error:`, err);
|
|
105
103
|
});
|
|
@@ -4,5 +4,8 @@ exports.isFileCached = isFileCached;
|
|
|
4
4
|
function isFileCached(cached, stats) {
|
|
5
5
|
if (!cached)
|
|
6
6
|
return false;
|
|
7
|
-
|
|
7
|
+
// Truncate to millisecond — APFS returns sub-ms precision that can
|
|
8
|
+
// differ across stat calls or serialization round-trips.
|
|
9
|
+
return (Math.trunc(cached.mtimeMs) === Math.trunc(stats.mtimeMs) &&
|
|
10
|
+
cached.size === stats.size);
|
|
8
11
|
}
|
package/package.json
CHANGED