You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Schedule configuration is authoritative in D1. Re-arm only schedules
106
-
// whose runner never confirmed the current revision; avoid disturbing
107
-
// healthy runner monitor alarms.
105
+
// Schedule configuration is authoritative in D1. Re-arm only runners
106
+
// that did not confirm their current revision. Active runs are included
107
+
// even when a recurrence was paused or archived: their monitor alarm is
108
+
// for settlement only and must not strand a leased capacity slot.
108
109
try{
109
110
constunarmed=awaitenv.DB.prepare(
110
-
"SELECT id, revision, next_due_at FROM scheduled_jobs WHERE enabled = 1 AND archived_at IS NULL AND next_due_at IS NOT NULL AND (armed_revision IS NULL OR armed_revision != revision) LIMIT 100",
"UPDATE scheduled_job_runs SET status = 'failed', failure_reason = COALESCE(failure_reason, 'Scheduled run did not finish preparation'), updated_at = ? WHERE id = ? AND status = 'preparing'",
36
+
)
37
+
expect(calls.map((call)=>call.sql)).toContain(
38
+
"UPDATE scheduled_run_slots SET run_id = NULL, lease_expires_at = NULL WHERE run_id = ?",
0 commit comments