bunkat / later

A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
http://bunkat.github.io/later/
MIT License
2.42k stars 244 forks source link

当cron表达式为 * * * * * ? * 时,报错 #243

Open Grapelllar opened 1 year ago

Grapelllar commented 1 year ago

this is my code:

timers[quartzJob.dynamicQuartz[key].id] = later.setInterval( async () => { await runQuartzJob(quartzJob.dynamicQuartz[key]); }, later.parse.cron(quartzJob.dynamicQuartz[key].cron, true) );

[2023-05-29T16:42:33.600] [DEBUG] [lib/module/quartz-server] what is parse cron ? [2023-05-29T16:42:33.601] [DEBUG] [lib/module/quartz-server] what is parse cron { schedules: [ {} ], exceptions: [] } [2023-05-29T16:42:33.601] [ERROR] [lib/module/quartz-server] Cannot read property 'constraint' of undefined 执行定时任务失败,查询数据库quartz失败:batch-job TypeError: Cannot read property 'constraint' of undefined at Object.later.compile (E:\Project\star-net\bimon-middleplatform-server\node_modules\later\later.js:573:54) at Object.later.schedule (E:\Project\star-net\bimon-middleplatform-server\node_modules\later\later.js:626:28) at Object.later.setTimeout (E:\Project\star-net\bimon-middleplatform-server\node_modules\later\later.js:810:19) at Object.setInterval (E:\Project\star-net\bimon-middleplatform-server\node_modules\later\later.js:843:19) at runQuartzJob (E:\Project\star-net\bimon-middleplatform-server\lib\module\/quartz-server.js:84:59) at processTicksAndRejections (internal/process/task_queues.js:95:5) at Object. (E:\Project\star-net\bimon-middleplatform-server\lib\module\/quartz-server.js:125:17)

MiaomiaoFanny commented 1 year ago

收到,谢谢。