mirror of
https://github.com/plashchynski/crono.git
synced 2026-03-28 12:22:04 +01:00
Handle a few jobs scheduled at the same time
This commit is contained in:
@@ -79,9 +79,10 @@ module Crono
|
||||
end
|
||||
|
||||
def start_working_loop
|
||||
while (job = Crono.scheduler.next)
|
||||
sleep(job.next - Time.now)
|
||||
job.perform
|
||||
while true
|
||||
next_time, jobs = Crono.scheduler.next_jobs
|
||||
sleep(next_time - Time.now)
|
||||
jobs.each(&:perform)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user