mirror of
https://github.com/plashchynski/crono.git
synced 2026-01-18 08:06:42 +01:00
Calling Time.zone.now in the if statement and while calculating sleep delay sometimes resulted in an exception with message "time interval must be positive". This happened if job was about to start and we needed to sleep for a really short period of time + server was under high load. First the application was checking if difference between current time and scheduled run time was positive. If the expression returned true, sleep was called, but required delay was calculated once again and could result in a negative value being passed to the sleep function.