node.js cron命令未执行
控制台窗口中什么都没有。 但是每秒应执行的命令未执行。 这是我的代码。
const cron = require('cron');
new cron.CronJob('* * * * * *', () => {
console.log("Execute")
},
null, true, "Asia/Seoul"
).start()
Nothing appears in the console window.
But the command that should be executed every second is not executed.
This is my code.
const cron = require('cron');
new cron.CronJob('* * * * * *', () => {
console.log("Execute")
},
null, true, "Asia/Seoul"
).start()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将cronjob定义为像
btw这样的句子。如果将第四个参数设置为true,则无需调用
start()
方法。Try to define a cronjob into a const like
Btw. you don't need to call the
start()
method if you set the fourth argument to true.