cron
cron copied to clipboard
issue when os time sync after app starting
Hello All , I have encounter an issue. we can get issue when we do step as follow:
- change OS time , by slower then network time;
- start our app, as sometime MM:SS start a job;
- sync OS time, from network; -------------when time MM:SS get, bug job can't start-------------
From the docs:
Cron entries are stored in an array, sorted by their next activation time. Cron sleeps until the next job is due to be run. Upon waking:
- it runs each entry that is active on that second
- it calculates the next run times for the jobs that were run
- it re-sorts the array of entries by next activation time.
- it goes to sleep until the soonest job.
The important part is the last line. The Cron will go to sleep until the next job is due. So this isn't exactly a bug but wanted behavior. Maybe the package should consider some catching mechanic for system clock change events?