cron icon indicating copy to clipboard operation
cron copied to clipboard

issue when os time sync after app starting

Open veritastry opened this issue 4 years ago • 1 comments

Hello All , I have encounter an issue. we can get issue when we do step as follow:

  1. change OS time , by slower then network time;
  2. start our app, as sometime MM:SS start a job;
  3. sync OS time, from network; -------------when time MM:SS get, bug job can't start-------------

veritastry avatar Nov 18 '20 07:11 veritastry

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?

skowrons avatar Feb 23 '21 11:02 skowrons