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
+2
View File
@@ -56,6 +56,8 @@ func (s *Store) ListRunsByTask(ctx context.Context, taskID int64) ([]Run, error)
// LastFinishedRunAt returns the most recent finished run's timestamp, or nil if
// the task has never completed a run — the baseline for the next scheduled run.
// The same max(finished_at) rule is also inlined in ListSchedulableTasks's
// subquery — keep the two in sync if this changes.
func (s *Store) LastFinishedRunAt(ctx context.Context, taskID int64) (*time.Time, error) {
var t *time.Time
err := s.Pool.QueryRow(ctx,