fix: anchor floor on re-enable; breaker on scheduled panic; propagate next-run err; reject negative interval; close phantom runs on startup
This commit is contained in:
@@ -19,7 +19,7 @@ const pollInterval = 30 * time.Second
|
||||
// run, or one interval after the schedule anchor if it has never completed one.
|
||||
func NextRun(interval time.Duration, anchor time.Time, lastFinished *time.Time) time.Time {
|
||||
base := anchor
|
||||
if lastFinished != nil {
|
||||
if lastFinished != nil && lastFinished.After(anchor) {
|
||||
base = *lastFinished
|
||||
}
|
||||
return base.Add(interval)
|
||||
|
||||
Reference in New Issue
Block a user