公告
财富商城
积分规则
提问
发文
2019-04-02 19:28发布
孤傲高冷的网名
I am using PM2 to keep my node.js apps running.
PM2
Is there any way to have PM2 restart my app every 1 hour?
Put the code below in pm2.js and start it with pm2 start pm2.js
pm2 start pm2.js
var pm2 = require('pm2'); pm2.connect(function(err) { if (err) throw err; setTimeout(function worker() { console.log("Restarting app..."); pm2.restart('app', function() {}); setTimeout(worker, 1000); }, 1000); });
More about this can be found here.
Additional resources:
最多设置5个标签!
Put the code below in pm2.js and start it with
pm2 start pm2.js
More about this can be found here.
Additional resources: