You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Couldn't find any more information on this anywhere - how do I reliably cancel recurring (manually set) jobs?
I have a job called recurring_payment, and once the user cancels their plan, it has to cancel the chain of recurring jobs as well.
However, on cancel, the job runner throws an error:
Error: job <id> (name: recurring_payment) cannot be updated in the database, maybe it does not exist anymore?
In essence, the job works like this: get current period end, add + 30 days to it and schedule another job, with the same arguments at the current period end date.
The text was updated successfully, but these errors were encountered:
I guess the solution would be to just remove this:
if (!result.acknowledged || result.matchedCount !== 1) {
throw new Error(`job ${id} (name: ${job.attrs.name}) cannot be updated in the database, maybe it does not exist anymore?`);
}
Couldn't find any more information on this anywhere - how do I reliably cancel recurring (manually set) jobs?
I have a job called
recurring_payment
, and once the user cancels their plan, it has to cancel the chain of recurring jobs as well.However, on cancel, the job runner throws an error:
In essence, the job works like this: get current period end, add + 30 days to it and schedule another job, with the same arguments at the current period end date.
The text was updated successfully, but these errors were encountered: