Skip to content

Commit

Permalink
Remove the usePolling chokidar option in generate-assets.js.
Browse files Browse the repository at this point in the history
With node version 20 the `usePolling` option is resulting in high cpu
usage.  The `followSymlinks` serves the purpose more correctly.  The
`usePolling` option was initially used because either the
`followSymlinks` option did not exist or there was a bug in chokidar and
that option wasn't working.  I can't remember the exact details. Note
that `followSymlinks` is true by default, and so it is not explicitly
set.

Also remove the `interval` option since that is only used when
`usePolling` is true.

The actual high cpu usage occurs with the PG generate-assets.js script,
and not this one with the `usePolling` option.  I don't really know why
though.  In any case the `followSymlinks` option is more correct for
what we want here.
  • Loading branch information
drgrice1 committed Sep 11, 2023
1 parent 8d0df7b commit 17aea34
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions htdocs/generate-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ if (argv.watchFiles) console.log('\x1b[32mEstablishing watches and performing in
chokidar.watch(['js', 'themes'], {
ignored: /layouts|\.min\.(js|css)$/,
cwd: __dirname, // Make sure all paths are given relative to the htdocs directory.
usePolling: true, // Needed to get changes to symlinks.
interval: 500,
awaitWriteFinish: { stabilityThreshold: 500 },
persistent: argv.watchFiles ? true : false
})
Expand Down

0 comments on commit 17aea34

Please sign in to comment.