lib/rufus/scheduler/jobs.rb in rufus-scheduler-3.3.2 vs lib/rufus/scheduler/jobs.rb in rufus-scheduler-3.3.3
- old
+ new
@@ -424,11 +424,11 @@
@times = opts[:times]
fail ArgumentError.new(
"cannot accept :times => #{@times.inspect}, not nil or an int"
- ) unless @times == nil || @times.is_a?(Fixnum)
+ ) unless @times == nil || @times.is_a?(Integer)
self.first_at =
opts[:first] || opts[:first_time] ||
opts[:first_at] || opts[:first_in] ||
nil
@@ -565,14 +565,13 @@
return if is_post
n = Rufus::Scheduler::ZoTime.now
@next_time =
- if @first_at == nil || @first_at < (n - @scheduler.frequency)
- nt = (@next_time || trigger_time || n) + @frequency
- nt > n ? nt : (trigger_time || n) + @frequency
- else
+ if @first_at && (trigger_time == nil || @first_at > n)
@first_at
+ else
+ (@next_time || n) + @frequency
end
end
def next_time_from(time)