1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00
endofunky--sidetiq/lib/sidetiq/schedule.rb

24 lines
495 B
Ruby
Raw Normal View History

2013-01-31 17:42:19 +00:00
module Sidetiq
# Internal: Recurrence schedules.
2013-01-31 17:42:19 +00:00
class Schedule < IceCube::Schedule
def method_missing(meth, *args, &block)
if IceCube::Rule.respond_to?(meth)
rule = IceCube::Rule.send(meth, *args, &block)
add_recurrence_rule(rule)
rule
else
super
end
end
def schedule_next?(time)
if @last_scheduled != (no = next_occurrence(time))
@last_scheduled = no
return true
end
false
end
end
end