-
Notifications
You must be signed in to change notification settings - Fork 19
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
Dynamic scheduling #13
Comments
In theory it might.. Combining their example with this gem would look something like config = {}
config[:send_emails] = {}
config[:send_emails][:class] = "SendEmail"
config[:send_emails][:args] = 'POC email subject'
config[:send_emails][:every] = ['1h', {first_in: 5.minutes}]
config[:send_emails][:persist] = true
# Wrap that object with this gem:
wrapped_schedule = ActiveScheduler::ResqueWrapper.wrap config
# Then pass it to resque as dynamic
Resque::Scheduler.dynamic = true
Resque.set_schedule("send_email", wrapped_schedule[:send_email]) Give it a shot, let me know if it works! |
Hey Justin, thanks for your fast reply! Reading your code i am wondering about these lines:
It seems we are not using ...
ActiveJob::Scheduler.dynamic = true
...
class SomeJob < ActiveJob::Base
...
def perform(arg1, arg2)
...
end
end
SomeJob.set_schedule(schedule)
# or
SomeJob.perform_with_schedule(schedule) Does that makes sense? |
Oh yeah... that would be a great deal new functionally.. don't think I'll get around to adding it. Probably would accept a PR if it was very clean with tons of tests, and didn't break how it works now; might be best to add that as a separate gem them though ( |
Does this work with dynamic-schedules?
I can't figure out how to use dynamic schedules with this gem, any help will be appreciated.
The text was updated successfully, but these errors were encountered: