From 0351079961beb633f17ceeea4bb6de1424ff2598 Mon Sep 17 00:00:00 2001 From: Dzmitry Plashchynski Date: Sat, 7 Mar 2015 01:38:50 +0200 Subject: [PATCH] Handle situation when Job#next is in the past --- lib/crono/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crono/job.rb b/lib/crono/job.rb index c7081a2..28a766b 100644 --- a/lib/crono/job.rb +++ b/lib/crono/job.rb @@ -11,7 +11,8 @@ module Crono end def next - period.next(since: last_performed_at) + next_time = period.next(since: last_performed_at) + next_time.past? ? period.next : next_time end def description