Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: set fs.watchFile poll interval to 1s #45536

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4448,6 +4448,9 @@ watch('somedir', (eventType, filename) => {
<!-- YAML
added: v0.1.31
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/45536
description: Changed default interval to 1000.
- version: v10.5.0
pr-url: https://github.com/nodejs/node/pull/20220
description: The `bigint` option is now supported.
Expand All @@ -4461,7 +4464,7 @@ changes:
* `options` {Object}
* `bigint` {boolean} **Default:** `false`
* `persistent` {boolean} **Default:** `true`
* `interval` {integer} **Default:** `5007`
* `interval` {integer} **Default:** `1000`
* `listener` {Function}
* `current` {fs.Stats}
* `previous` {fs.Stats}
Expand Down
5 changes: 1 addition & 4 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2359,10 +2359,7 @@ function watchFile(filename, options, listener) {
}

options = {
// Poll interval in milliseconds. 5007 is what libev used to use. It's
// a little on the slow side but let's stick with it for now to keep
// behavioral changes to a minimum.
interval: 5007,
interval: 1000,
persistent: true,
...options
};
Expand Down