Skip to content

Add initial delay to cron execution #2169

@emir7

Description

@emir7

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

When the server performs bootstrap logic on startup, scheduled cron jobs may run before the application is fully ready.
It would be useful to support an initial delay before the first cron execution, after which the job runs according to its configured schedule.

Describe the solution you'd like

A possible solution is to add an initialDelay parameter that offsets the first job execution by a configurable number of milliseconds.
(I am also willing to prepare a pull request if you find such feature useful)

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

Applications often execute bootstrap logic during startup, such as database migrations, cache warm-up, establishing external connections, or waiting for dependent services to become available.

Currently, scheduled cron jobs may execute immediately after application startup, before this initialization has completed. This can lead to transient failures, unnecessary load, or inconsistent behavior.

Allowing an initial delay before the first execution of a cron job enables applications to complete their bootstrap phase before background jobs begin running, resulting in more predictable and reliable startup behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions