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:
2026-07-03 13:31:58 +07:00
parent e8acab6920
commit 64bcb1d60b
7 changed files with 55 additions and 10 deletions
+1 -1
View File
@@ -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)