watch: decrease debounce rate

PR-URL: https://github.com/nodejs/node/pull/48926
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Moshe Atlow authored and RafaelGSS committed 2023-08-17 08:35:56 -03:00
1 parent a12996298e
commit b79b2927ca
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ const args = ArrayPrototypeFilter(process.execArgv, (arg, i, arr) =>
arg !== '--watch' && arg !== '--watch-preserve-output');
ArrayPrototypePushApply(args, kCommand);
const watcher = new FilesWatcher({ debounce: 500, mode: kShouldFilterModules ? 'filter' : 'all' });
const watcher = new FilesWatcher({ debounce: 200, mode: kShouldFilterModules ? 'filter' : 'all' });
ArrayPrototypeForEach(kWatchedPaths, (p) => watcher.watchPath(p));
let graceTimer;
+1 -1
View File
@@ -428,7 +428,7 @@ function runTestFile(path, root, inspectPort, filesWatcher, testNamePatterns) {
function watchFiles(testFiles, root, inspectPort, signal, testNamePatterns) {
const runningProcesses = new SafeMap();
const runningSubtests = new SafeMap();
const watcher = new FilesWatcher({ debounce: 500, mode: 'filter', signal });
const watcher = new FilesWatcher({ debounce: 200, mode: 'filter', signal });
const filesWatcher = { __proto__: null, watcher, runningProcesses, runningSubtests };
watcher.on('changed', ({ owners }) => {
+1 -1
View File
@@ -31,7 +31,7 @@ class FilesWatcher extends EventEmitter {
#mode;
#signal;
constructor({ debounce = 500, mode = 'filter', signal } = kEmptyObject) {
constructor({ debounce = 200, mode = 'filter', signal } = kEmptyObject) {
super();
validateNumber(debounce, 'options.debounce', 0, TIMEOUT_MAX);