pm2
pm2 copied to clipboard
Can pm2 restart every 10 seconds?
Hi guys, B/c pm2's config is using crontab to do restart task, and crontab is not able to do with second-level task, the minimal tick size for crontab is 1 minute. So can pm2 restart my process every X seconds? Thanks
@KaitaoQiu
It should be possible by passing an extra parameter for seconds to --cron-restart (which is described at https://pm2.keymetrics.io/docs/usage/restart-strategies/ )
So try:
pm2 start app.js --cron-restart="*/10 * * * * *"
Plast note that this require version 5.2.0, not sure how it works before that.