Search code examples
node.jspm2

What is the time unit for pm2 watch_delay option?


The pm2 docs say there is an option to set a watch-delay in a configuration file like this:

module.exports = {
  apps: [{
    script: "app.js",
    watch: ["server", "client"],
    // Delay between restart
    watch_delay: 1000,
    ignore_watch : ["node_modules", "client/img"],
  }]
}

But it does not mention the time unit for the watch_delay option. Is it ms? Does anyone know what the time unit is? If it is ms, is there anywhere in the docs that this can be confirmed?


Solution

  • watch_delay value time unit is millisecond.

    To be more specific, the pm2 --help says tha you can add --watch-delay 4 or --watch-delay 4000 for a delay of 4 s.