Skip to content

Conversation

@top-sigrid
Copy link

Fixes #810

Summary

  • Move invoking schedule hooks from enqueue_from_config to enqueue_recurring
  • This ensures hooks are called for cron jobs but not again when delayed jobs are transferred to the work queue
  • Extract extract_klass_and_params helper to avoid duplication
  • Update README to clarify when hooks are called

@top-sigrid
Copy link
Author

top-sigrid commented Dec 25, 2025

Regarding my discussion points from #810 I went with the solution that for enqueing recurring cron jobs the schedule-hooks are also called. Altgough that doesn't mean they are "placed on the delayed queue" I think this actually is a scheduling operation. Also #792 just a year ago quite explicitely introduced this. Hence I adjusted the Readme on this new functioning of the hooks.

I hope you are fine with this approach, cc @PatrickTulskie.

I think the CI failures are all unrelated to this fix. There is 1 actual test failure for Ruby 2.4 that I'll look into.

Let me know what you think of this and happy holidays

Edit: I also opened #813 for the flaky test (as it is unrelated to the changes in this PR)

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.

after_schedule hook is called during handle_delayed_items re-enqueue

1 participant