Skip to content

Fix schedule hooks firing when timestamp <= now#817

Open
top-sigrid wants to merge 1 commit intoresque:masterfrom
top-sigrid:fix-schedule-hooks-for-past-times
Open

Fix schedule hooks firing when timestamp <= now#817
top-sigrid wants to merge 1 commit intoresque:masterfrom
top-sigrid:fix-schedule-hooks-for-past-times

Conversation

@top-sigrid
Copy link
Copy Markdown

When enqueue_at is called with a timestamp in the past or equal to now, the job bypasses the delayed queue and goes directly to the work queue. Previously, before_schedule and after_schedule hooks were incorrectly called in this case.

This fix moves process_schedule_hooks inside the else branch so hooks only fire when jobs actually enter the delayed queue.

Fixes #816

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.

schedule hooks fire when timestamp is <= now, although jobs bypass the delayed queue entirely in that case

1 participant