From 3b5810463e7c39b0a8e2856c996faf454a6ca1f8 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:32:58 -0500 Subject: [PATCH] feat: always use polling on IBM i 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 --- lib/monitor/watch.js | 4 ++++ lib/utils/index.js | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index 1ef14086..8ee41f0a 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -69,6 +69,10 @@ function watch() { watchOptions.disableGlobbing = true; } + if (utils.isIBMi) { + watchOptions.usePolling = true; + } + if (process.env.TEST) { watchOptions.useFsEvents = false; } diff --git a/lib/utils/index.js b/lib/utils/index.js index c4803383..92651216 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -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) {