Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/payload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"busboy": "^1.6.0",
"ci-info": "^4.1.0",
"console-table-printer": "2.12.1",
"croner": "9.1.0",
"croner": "10.0.1",
Comment thread
DanRibbens marked this conversation as resolved.
"dataloader": "2.2.3",
"deepmerge": "4.3.1",
"file-type": "21.3.4",
Expand Down
2 changes: 2 additions & 0 deletions packages/payload/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export const bin = async () => {
{
// Do not run consecutive crons if previous crons still ongoing
protect: true,
// TODO: Remove this compatibility option in 4.0. This only exists to ensure backwards-compatibility between Croner v9 and Croner v10 cron syntax
sloppyRanges: true,
},
)

Expand Down
5 changes: 5 additions & 0 deletions packages/payload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,13 @@ export class BasePayload {
})
},
{
catch: (err) => {
this.logger.error({ err, msg: 'Error in job queue cron job handler' })
},
// Do not run consecutive crons if previous crons still ongoing
protect: true,
// TODO: Remove this compatibility option in 4.0. This only exists to ensure backwards-compatibility between Croner v9 and Croner v10 cron syntax
sloppyRanges: true,
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ export function checkQueueableTimeConstraints({
? queueScheduleStats?.tasks?.[taskConfig.slug]?.lastScheduledRun
: queueScheduleStats?.workflows?.[workflowConfig?.slug ?? '']?.lastScheduledRun

const nextRun = new Cron(scheduleConfig.cron).nextRun(lastScheduledRun ?? undefined)
const nextRun = new Cron(scheduleConfig.cron, {
// TODO: Remove this compatibility option in 4.0. This only exists to ensure backwards-compatibility between Croner v9 and Croner v10 cron syntax
sloppyRanges: true,
}).nextRun(lastScheduledRun ?? undefined)

if (!nextRun) {
return false
Expand Down
Loading
Loading