在初始运行时,它会运行 app.js,但是会在间隔时跳过它。我在这里可能做错了什么?
var cron = require('node-cron');
cron.schedule('*/10 * * * * *', function(){
var shell = require('./app.js');
commandList = [
"node app.js"
]
console.log('Bot successfully executed');
});
日志:
ec2-user:~/environment $ node forever.js
Bot successfully executed
You have already retweeted this Tweet.
You have already retweeted this Tweet.
Bot successfully executed
Bot successfully executed
Bot successfully executed
Bot successfully executed
Bot successfully executed
Bot successfully executed
Bot successfully executed
Bot successfully executed