Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Recurrence Rule (rfc 5545, "rrule") support for repeating jobs #1987

Open
adamlounds opened this issue Mar 1, 2021 · 1 comment

Comments

@adamlounds
Copy link

Enhancement Request

Support rrule (rfc5545) syntax as well as cron syntax for repeating jobs

paymentsQueue.add(paymentsData, {repeat: {rrule: 'DTSTART:20210401T23:59:59Z\nFREQ=DAILY;COUNT=2'}});

Recurrence rules are much more flexible than cron specifications, supporting things like "every monday and wednesday", or "the last thursday of the month, for five months". There's a js library to parse/validate rrules, which can generate the next Date the job should be run via

const rrule = rrulestr('DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5')
const nextRun = rrule.after(new Date);

This should be reasonably straightforward to add to getNextMillis, but rrule has some "quirks" if the system is not set to run in the UTC timezone.

@adamlounds adamlounds changed the title Recurrence Rule (rfc 5545, "rrule") support for repeating jobs Enhancement: Recurrence Rule (rfc 5545, "rrule") support for repeating jobs Mar 1, 2021
@emanuelet
Copy link

I am using this temporarily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants