Files
qinglong/back/shared/executionIdentity.ts
T
whyour 8a9e70e90b feat: harden cron execution recovery and expose scheduling diagnostics
Reconcile scheduled and system cron triggers, isolate concurrent executions and retain verifiable exit statistics across restarts. Add paged task history, log and script browsing, dashboard timing details and regression coverage.
2026-11-17 01:01:57 +08:00

14 lines
598 B
TypeScript

// The original scheduled CLI wire format maps to its existing persisted trigger ID.
export const executionIdPattern = /^(?:client-|legacy-system:\d{1,12}:)[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/;
export function executionTriggerId(id: string) {
return id.replace('legacy-system:', 'system-cli-').replace(':', '-');
}
// A header lets upgraded clients keep the same identified body on older panels.
export function receiptFinishTime(header?: string) {
if (header && /^\d{1,13}$/.test(header)) {
const time = Number(header);
if (time > 0 && time <= Date.now()) return time;
}
}