[英]While scheduled function to call every 2 minutes in PM2 but old process is auto terminate
I have implemented a function in js file using nodejs application things are working fine but when I try to run every 2 minutes with the help of pm2 Every 2 mins my execution started auto but the issue is auto terminate old process.我已经使用nodejs应用程序在 js 文件中实现了一个 function 一切正常,但是当我尝试在pm2的帮助下每 2 分钟运行一次时,我的执行每 2 分钟自动启动一次,但问题是自动终止旧进程。
pm2 restart inbox.js --cron "*/2 * * * *"
pm2 start inbox.js --cron "*/2 * * * *"
1st execution 12:00 AM第一次执行 12:00 AM
2nd execution 12:02 AM第二次执行 12:02 AM
3rd execution 12:04 AM第三次执行 12:04 AM
When start 2nd execution then 1st execution auto terminate when start 3rd execution then 2nd execution auto terminate当开始第二次执行时,第一次执行自动终止当开始第三次执行时,第二次执行自动终止
I want to keep running all execution until all execution done我想继续运行所有执行直到所有执行完成
App built : nodejs and expressjs应用程序构建:nodejs 和 expressjs
Os : amazon-linux操作系统:亚马逊Linux
Replace restart
with start
and try again将
restart
替换为start
并重试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.