你在调度Node Cron任务时出错了。现在就修正它!
原文英文,约1900词,阅读约需7分钟。发表于: 。So, I had a cron server running multiple tasks. I had a task lets call to it x-task that was supposed to run every day 5.00 PM and few others that supposed to run at different times. I had...
本文讨论了使用node-cron包调度任务时的问题。作者的x-task任务每天5点运行,但却多次执行。原因是node-cron使用6个参数,而传统cron只用5个。正确的调度格式应为“0 0 17 * * *”,并提供了代码片段以生成正确的cron表达式。