【发布时间】:2019-05-10 02:43:35
【问题描述】:
我想在特定条件下停止节点 cron 作业。
这就是我开始每 1 秒运行一次任务的方式。
const runScheduler = (url)=>{
cron.schedule('*/1 * * * * *', () => {
console.log('running a task every one second');
async.waterfall([ getUrlDelay(url), dbMethods.updateUrlResponses(url) ],function(err, success){
if(err) return console.log('Url Not Found');
})
});
}
我想停止这项工作,但无法完成。
【问题讨论】: