Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled Unique Jobs Not Being Enqueued #15

Closed
lsimoneau opened this issue Jun 1, 2013 · 3 comments
Closed

Scheduled Unique Jobs Not Being Enqueued #15

lsimoneau opened this issue Jun 1, 2013 · 3 comments

Comments

@lsimoneau
Copy link
Contributor

Since updating Sidekiq to 2.12.1, unique jobs that I try to schedule 5 minutes in the future with:

JobClass.perform_in(5.minutes, args)

do wind up in the schedule, but then when five minutes rolls around they go away and are not enqueued or performed. It looks like there was a change to the way Sidekiq uses middleware for scheduled jobs (it now calls client middleware when scheduled jobs or retries are put on the queue).

Is it possible that the sidekiq-unique-jobs middleware is setting the payload hash key when the job is scheduled, and since the new Sidekiq version also calls client middleware when the scheduled job is then enqueued, it's not enqueued because the hash is already there?

@lsimoneau
Copy link
Contributor Author

I've had a closer look, and that is indeed what's happening. I'll put together a fix and send you a pull request.

@disbelief
Copy link
Contributor

This also appears to be happening to jobs that aren't unique, if the sidekiq-unique-jobs middleware is in the chain.

I only use sidekiq-unique-jobs for certain workers, but I've noticed that any scheduled worker disappears from the queue at the time scheduled without being performed.

@disbelief
Copy link
Contributor

I knocked out a quick PR (#17) that seems to solve the problem for me.

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

No branches or pull requests

3 participants