Add cron_retrigger for consumed one-shot jobs.

Resume only unpauses; listeners need a native way to re-fire the same job id with a new run without creating duplicate executors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-10 17:40:39 +08:00
parent 6724332114
commit c11221606a
9 changed files with 324 additions and 7 deletions

View file

@ -10,6 +10,7 @@ import { appendRun, getJob, patchRun, upsertJob } from './store.js'
import { ACTIVE_RUN_STATUSES } from './fire-status.js'
import {
findLabelOverlapRun,
isRetriggerable,
normalizeLabels,
projectJobState,
} from './monitor.js'
@ -127,6 +128,7 @@ export function publicJob(job, runs = null) {
state: stateInfo.state,
stateEnteredAt: stateInfo.stateEnteredAt,
stuck: stateInfo.stuck === true,
retriggerable: isRetriggerable(job, jobRuns || []),
...job.origin ? { origin: job.origin } : {},
schedule: job.schedule,
createdAt: job.createdAt,