Improved execution of scheduled events on startup #42
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
suggestion
support
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/hazaar-warlock#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
When warlock starts up, any events that are due to be executed on a repeating schedule that is currently active, will execute immediately because they have no last execution time. I would like to make this a bit smarter. Something like only do it if the last scheduled time is less than a certain period (or percentage of the delay time) ago. This means that if these events we ONLY JUST supposed to be executed a short time ago, they will be executed, but if they are not supposed to execute for a few hours or something, then they will not.
Alternatively, I could just make it so that if the event has not be executed before then it will not execute on startup but will instead exec at the next scheduled time. This could be "phase 1".
changed the description
All sorted. This was fixed in both MVC and here. Basically the
\Hazaar\Cron
class was not really handling the next occurrence correctly, which meant that for a whole minute the "next" occurrence could be the current minute, which is not desirable. I made a small tweak that means the checking the next occurrence calculates of the following minute and everything appears to work. Warlock services just needed the$exec['when'] + 60
code to be removed so that the reference time is the next minute afternow
.closed
mentioned in commit
fa45447153