Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix potential time shift in EveryJob #181
First I'd like to thank you for this awesome work on rufus-scheduler :)
I use rufus-scheduler (with resque-scheduler) in production to run jobs every 60s and I noticed that the schedule time shifted by ~1s every 15 minutes.
This was problematic to me because I rely heavily on time to do my computations, so I read the code and found the set_next_time method of Rufus::Scheduler::EveryJob was relying on the trigger time to define the next run of the job. I implemented a change to rely on the old @next_time value if it is defined to avoid time shift due to compute time or tick interval, it seems more logical and actually works perfectly for me.
What do you think ?
Please let me know if anything is unclear