Skip to content

Conversation

@paroe
Copy link
Contributor

@paroe paroe commented Sep 29, 2025

This PR addresses excessive re-scheduling in the JobRecurringScheduleListener.

Currently, there are two issues in my opinion:

  1. The listener purges all schedules, including those from Symfony's native Scheduler bundle.
    This means that if you have other tasks defined with the #[AsCronTask(...)] attribute, all but the first one are purged and will no longer be executed.
    The first one still runs, but only because of the $key === 0 check.

  2. The schedule is recalculated whenever any recurring job is executed, rather than only when the heartbeat is received.
    With many recurring jobs, this leads to unnecessary load.

@Matys333
Copy link
Collaborator

Thanks @paroe, much appreciated, this slipped past me.

@Matys333 Matys333 merged commit 1d5301c into TomAtomCZ:main Sep 30, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants