GeezerVison is showing github.com — watch: decrease debounce rate · nodejs/node@f27d505
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/main/watch_mode.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ const args = ArrayPrototypeFilter(process.execArgv, (arg, i, arr) => | 42 | 42 | arg !== '--watch' && arg !== '--watch-preserve-output'); | 43 | 43 | ArrayPrototypePushApply(args, kCommand); | 44 | 44 |
| 45 | | -const watcher = new FilesWatcher({ debounce: 500, mode: kShouldFilterModules ? 'filter' : 'all' }); | | 45 | +const watcher = new FilesWatcher({ debounce: 200, mode: kShouldFilterModules ? 'filter' : 'all' }); | 46 | 46 | ArrayPrototypeForEach(kWatchedPaths, (p) => watcher.watchPath(p)); | 47 | 47 |
| 48 | 48 | let graceTimer; | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -419,7 +419,7 @@ function runTestFile(path, root, inspectPort, filesWatcher, testNamePatterns) { | 419 | 419 | function watchFiles(testFiles, root, inspectPort, signal, testNamePatterns) { | 420 | 420 | const runningProcesses = new SafeMap(); | 421 | 421 | const runningSubtests = new SafeMap(); | 422 | | - const watcher = new FilesWatcher({ debounce: 500, mode: 'filter', signal }); | | 422 | + const watcher = new FilesWatcher({ debounce: 200, mode: 'filter', signal }); | 423 | 423 | const filesWatcher = { __proto__: null, watcher, runningProcesses, runningSubtests }; | 424 | 424 |
| 425 | 425 | watcher.on('changed', ({ owners }) => { | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/watch_mode/files_watcher.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,7 @@ class FilesWatcher extends EventEmitter { | 31 | 31 | #mode; | 32 | 32 | #signal; | 33 | 33 |
| 34 | | - constructor({ debounce = 500, mode = 'filter', signal } = kEmptyObject) { | | 34 | + constructor({ debounce = 200, mode = 'filter', signal } = kEmptyObject) { | 35 | 35 | super(); | 36 | 36 |
| 37 | 37 | validateNumber(debounce, 'options.debounce', 0, TIMEOUT_MAX); | |
|