If you want to complete this loop operation without accessing the nodejs program through the command line or browser, you can try node-schedule, a scheduled execution module of nodejs, host the project in the background using pm2, and then use the scheduled module Just execute the logic code once in 2S
Loop: infinite loop setTimeout
Recursive: setTimeout recursive
setInterval timing
If you want to complete this loop operation without accessing the nodejs program through the command line or browser, you can try node-schedule, a scheduled execution module of nodejs, host the project in the background using pm2, and then use the scheduled module Just execute the logic code once in 2S
https://github.com/merencia/n...
node 版 crontab