Skip to content

Job scheduling: save nextExecution in the DB to be more resilient to service outages #557

@matthiasfeist

Description

@matthiasfeist

As far as I understand it, pgBoss requires that an instance of the service is running at the exact time when a job is scheduled to be executed.
If my service happens to be restarting, deploying or whatever during that time, the scheduled job will not get executed.

If I understand that correctly, maybe a suggestion could be to save the next scheduled execution time in the DB on the schedule. When the service comes online, bgBoss can then check if the next_scheduled_time is in the past. If it is, that indicates that an execution was missed and the event can be fired right then and there.

This should probably be configurable, of course.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions