-
Notifications
You must be signed in to change notification settings - Fork 479
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
would it be possible to allow for unique delayed jobs? #113
Comments
I get this request (or very similar) every few months. I am not fan of putting this functionality in resque-scheduler. It On Oct 8, 2011, at 1:35 PM, Marc MacLeod
|
Hmm ok. Would something like this at the end of the job work to remove any duplicates? class SomeJob |
No, I would not suggest tying it to resque-scheduler at all. Take a look at the discussion in this pull request: #52 In short, if you want a job to only one at most, once per X, preventing it at the resque-scheduler level is probably not the right place. It's fastest/easiest to just store the last time (or next time) you want a job to actually do work and just have all the rest skip the work. That way you can keep blindly enqueuing them (now or in the future) and the job will keep track of whether or not to actually perform the work. Again, this should be a pretty straight forward plugin to write if you wanted a more general solution. |
Similar to resque-loner? A use-case here is I put in a delayed job to send a notification email 30 minutes from now. If another notification is added before the 30 minutes I don't want to add another send email delayed job. When the job is run it aggregates all the new notifications and sends them in one email.
The text was updated successfully, but these errors were encountered: