Fix error when next time in the past

This commit is contained in:
Dzmitry Plashchynski
2015-04-12 17:04:07 +03:00
parent e8812b1329
commit 84ac08e5d4

View File

@@ -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