mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-24 17:58:39 +02:00
Fix error when next time in the past
This commit is contained in:
@@ -82,7 +82,7 @@ module Crono
|
|||||||
def start_working_loop
|
def start_working_loop
|
||||||
loop do
|
loop do
|
||||||
next_time, jobs = Crono.scheduler.next_jobs
|
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)
|
jobs.each(&:perform)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user