-
Notifications
You must be signed in to change notification settings - Fork 480
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
Allow duration to be used for scheduling every #607
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,22 @@ | |
assert job.opts.keys.include?(:first_in) | ||
end | ||
|
||
test 'load_schedule_job with every fixnum' do | ||
Resque::Scheduler.load_schedule_job( | ||
'some_ivar_job', | ||
'every' => 30, | ||
'class' => 'SomeIvarJob', | ||
'args' => '/tmp' | ||
) | ||
|
||
assert_equal(1, Resque::Scheduler.rufus_scheduler.jobs.size) | ||
assert_equal(1, Resque::Scheduler.scheduled_jobs.size) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not test the new job is well scheduled every 30s, and not 30m or 30ms ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed, we need to test the actual schedule that's configured in the scheduler here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @josephpage @iloveitaly definitely, updated! |
||
assert Resque::Scheduler.scheduled_jobs.keys.include?('some_ivar_job') | ||
job = Resque::Scheduler.rufus_scheduler.jobs.first | ||
next_times = job.next_times(2) | ||
assert_equal(30, next_times[1] - next_times[0]) | ||
end | ||
|
||
test 'load_schedule_job with cron with options' do | ||
Resque::Scheduler.load_schedule_job( | ||
'some_ivar_job', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this fixing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iloveitaly I believe this is since the interval type can now be
Numeric
andempty?
is aString
only.