Skip to content

Fix schedule hooks firing when timestamp <= now#817

Open
top-sigrid wants to merge 1 commit into
resque: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 into
resque:masterfrom
top-sigrid:fix-schedule-hooks-for-past-times

Conversation

@top-sigrid

Copy link
Copy Markdown
Contributor

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

@PatrickTulskie

Copy link
Copy Markdown
Member

@top-sigrid I think this is fine to merge, but it could use a rebase. Mind rebasing on master, pushing it up and let's see if CI passes.

@top-sigrid

Copy link
Copy Markdown
Contributor Author

Hi Patrick, thanks for getting back to this! I can definitely do that, will find the time very soon. Probably a good idea to do this for my other PRs aswell :)

@PatrickTulskie

Copy link
Copy Markdown
Member

@top-sigrid oh yeah actually you're right there are a few that we can probably merge in once they are rebased. I'm aiming to get a few resque releases out around mid-month. If we can get them in before that they'll make the release. Holler when you want me to check them!

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

2 participants