lib/rufus/scheduler/jobs_one_time.rb in rufus-scheduler-3.8.2 vs lib/rufus/scheduler/jobs_one_time.rb in rufus-scheduler-3.9.0
- old
+ new
@@ -6,10 +6,18 @@
def occurrences(time0, time1)
(time >= time0 && time <= time1) ? [ time ] : []
end
+ # Used when discard_past? is set to true or :fail at scheduler or job level...
+ #
+ def past?
+
+ @next_time &&
+ @next_time < Time.now - @scheduler.frequency
+ end
+
protected
def determine_id
[
@@ -18,10 +26,10 @@
@next_time.to_f,
(self.object_id < 0 ? 'm' : '') + self.object_id.to_s
].map(&:to_s).join('_')
end
- # There is no next_time for one time jobs, hence the false.
+ # There is no "next time" for one time jobs, hence the false.
#
def set_next_time(trigger_time, is_post=false, now=nil)
@next_time = is_post ? nil : false
end