diff --git a/tools/fs/watch.js b/tools/fs/watch.js index f0dd088070..a5a2e01f56 100644 --- a/tools/fs/watch.js +++ b/tools/fs/watch.js @@ -11,6 +11,9 @@ import { optimisticHashOrNull, } from "./optimistic.js"; +const WATCH_COALESCE_MS = + process.env.METEOR_FILE_WATCH_COALESCE_MS || 100; + // Watch for changes to a set of files, and the first time that any of // the files change, call a user-provided callback. (If you want a // second callback, you'll need to create a second Watcher.) @@ -501,8 +504,7 @@ export class Watcher { // additional calls if they happen within that window of time, so that // a rapid succession of calls will tend to trigger only one inspection // of the file system. - const coalesceMs = process.env.METEOR_FILE_WATCH_COALESCE_MS || 100; - return coalesce(coalesceMs, function onWatchEvent() { + return coalesce(WATCH_COALESCE_MS, function onWatchEvent() { if (self.stopped) { return; }