Not sure how to make pm2 run a Javascript that restart at 23 PM 59 sec everyday then enables auto restart for 10 mins to next day's 00:09 then no-autorestart
for the rest of the day until reaching 23:59 again...
Only able to set it to restart at 23:59 but with no autorestart: pm2 start index.js --no-autorestart --cron "59 23 */1 * *"
How can I make it then auto restart between 23:59 until 00:09 then return back to no-autorestart setting?
Found out that using pm2
will cause the script to crash (Used for creating Discord bot, When using pm2 the script will crash and immediately restarted by pm2 then Discord will reset token if connect more than 1000 times, causing the script to not be able to run automatically) but the issue was fixed by switching to forever
npm.