Skip to content

Commit

Permalink
feat: always use polling on IBM i
Browse files Browse the repository at this point in the history
IBM i does not support fs.watch

https://nodejs.org/api/fs.html#caveats

Therefore we always want to use polling on IBM i systems
  • Loading branch information
abmusse committed Jun 29, 2023
1 parent 6787871 commit 3b58104
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function watch() {
watchOptions.disableGlobbing = true;
}

if (utils.isIBMi) {
watchOptions.usePolling = true;
}

if (process.env.TEST) {
watchOptions.useFsEvents = false;
}
Expand Down
1 change: 1 addition & 0 deletions lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var utils = (module.exports = {
isWindows: process.platform === 'win32',
isMac: process.platform === 'darwin',
isLinux: process.platform === 'linux',
isIBMi: require('os').type() === 'OS400',
isRequired: (function () {
var p = module.parent;
while (p) {
Expand Down

0 comments on commit 3b58104

Please sign in to comment.