mirror of
https://github.com/plashchynski/crono.git
synced 2026-05-21 15:36:52 +02:00
Jobs scheduled at same time exclude each other. #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @thomasfedb on GitHub (Apr 6, 2015).
If two jobs are scheduled to execute at the same time, they may be missed.
Example
cronotab.rb:Rather than simply taking the next job off the queue, crono should check which jobs have not been executed and which should be executed.
Psudo-code for the described logic:
@plashchynski commented on GitHub (Apr 8, 2015):
Hello,
Thank you for the report, what do you think about such implementation https://github.com/plashchynski/crono/commit/b4ad8fb953eed06914345c20021c4e06626d9727 Scheduler#next_jobs simply returns all jobs scheduled at the same time.
@thomasfedb commented on GitHub (Apr 12, 2015):
I still feel that you have the possibility of missing jobs while spending time spinning up threads for a batch of jobs. Have a look at the implimentation in clockwork.
@thomasfedb commented on GitHub (Apr 12, 2015):
Your changes are definitely an improvement however.
@plashchynski commented on GitHub (Apr 13, 2015):
The clockwork implementation is very simple and reliable. However, I would not want to do such cycle with frequent checks. It requires more CPU time, especially if there are a lot of scheduled jobs and high frequency of checks in the cycle (sleep_timeout option). I'd want the daemon to peacefully sleep until the time comes. I've improved the implementation by adding the
nexttime cache on the job class https://github.com/plashchynski/crono/commit/6d41a19212888e9273530bb2aad47c5a95871ee9 I believe it should correct such problems. if not, we will consider other variants of implementation.@thomasfedb commented on GitHub (Apr 14, 2015):
Hey. I'm away till next week and will have a look at this then.
@andre8888 commented on GitHub (Aug 26, 2016):
Does anyone still running into this? I have 3 jobs scheduled to run at the same time but none gets ran. I can hardly replicate this issue consistently.