Skip to content

Commit 17e2914

Browse files
committed
fs: set fs.watchFile poll interval to 1s
1 parent 5af2021 commit 17e2914

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

doc/api/fs.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4448,6 +4448,9 @@ watch('somedir', (eventType, filename) => {
44484448
<!-- YAML
44494449
added: v0.1.31
44504450
changes:
4451+
- version: REPLACEME
4452+
pr-url: https://github.com/nodejs/node/pull/45536
4453+
description: Changed default interval to 1000.
44514454
- version: v10.5.0
44524455
pr-url: https://github.com/nodejs/node/pull/20220
44534456
description: The `bigint` option is now supported.
@@ -4461,7 +4464,7 @@ changes:
44614464
* `options` {Object}
44624465
* `bigint` {boolean} **Default:** `false`
44634466
* `persistent` {boolean} **Default:** `true`
4464-
* `interval` {integer} **Default:** `5007`
4467+
* `interval` {integer} **Default:** `1000`
44654468
* `listener` {Function}
44664469
* `current` {fs.Stats}
44674470
* `previous` {fs.Stats}

lib/fs.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,10 +2359,7 @@ function watchFile(filename, options, listener) {
23592359
}
23602360

23612361
options = {
2362-
// Poll interval in milliseconds. 5007 is what libev used to use. It's
2363-
// a little on the slow side but let's stick with it for now to keep
2364-
// behavioral changes to a minimum.
2365-
interval: 5007,
2362+
interval: 1000,
23662363
persistent: true,
23672364
...options
23682365
};

0 commit comments

Comments
 (0)