From 84ac08e5d4ad2e22f120853636490ad6c83b667d Mon Sep 17 00:00:00 2001 From: Dzmitry Plashchynski Date: Sun, 12 Apr 2015 17:04:07 +0300 Subject: [PATCH] Fix error when next time in the past --- lib/crono/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crono/cli.rb b/lib/crono/cli.rb index f10f545..aa7eb98 100644 --- a/lib/crono/cli.rb +++ b/lib/crono/cli.rb @@ -82,7 +82,7 @@ module Crono def start_working_loop loop do next_time, jobs = Crono.scheduler.next_jobs - sleep(next_time - Time.now) + sleep(next_time - Time.now) if next_time > Time.now jobs.each(&:perform) end end