mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
a12996298e
commit
b79b2927ca
3 files changed
+3
-3
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user