Closed elektro-potkan closed 2 years ago
Hi, I miss the point of this change. What do you mean with so I was missing the option to run the jobs during the next run
?
Hi @f3l1x,
the point is, that if the scheduler's run method (in current implementation) is called approximately each 15 minutes (so it is not called at some precise time), it will sometime (or in most cases, it depends) call the job's isDue method before and after the right time. As the ExpressionJob is simply calling Cron\CronExpression::isDue, the job might never run. To reliably run in such environment, it should also check for the condition described above and in such case return true even when called after the right time. But it needs to know the previous time it was called - and I think, the scheduler should supply it with such an information (instead of implementing the timestamp load/save in each job).
I've looked at your fork. Seems it's working for you and you've added more features. Keep it this way and I am closing it here.
Thank you for your work on that.
Hello all,
I cannot always run the scheduler each minute, so I was missing the option to run the jobs during the next run.
I have added into
LockingScheduler
the ability to store last-run timestamp (heavily inspired by baraja-core/cronner, but only scheduler-level, as I do not need it in the job-level). I have used this scheduler as it already has configured a directory for storing its locks. If I should implemented it in a separate Scheduler, please, let me know.Due to this, a change in the IJob definition was needed. If it should be done backward-compatible (though the package is in 0.x version), I could reimplement it using another interface.
The documentation is not edited (yet, would like to hear from You first).
Thank You for Your response.
Best regards