Lift process.env access to module scope.

https://github.com/meteor/meteor/pull/9911#pullrequestreview-123587003
This commit is contained in:
Ben Newman
2018-05-27 11:13:47 -04:00
parent 797f9ce78e
commit ad4f30c684

View File

@@ -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;
}