Skip to content

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

@adamlounds

Description

@adamlounds

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions