Files
EpicNext-Cms/src/lib/furni/import-job-retry.ts
T
Simo c389c3893d
CI / check (push) Successful in 52s
CI / deploy (push) Successful in 2m10s
CI / publish-container (push) Failing after 1m18s
feat(cms): improve catalog, editorial recovery and operations
2026-09-09 19:36:15 +02:00

13 lines
536 B
TypeScript

import type { ImportJob } from "./import-job";
/** Never requeue an active job or furniture already imported successfully. */
export function retryableJobItems(job: ImportJob): ImportJob["items"] {
if (job.state === "running" || job.state === "queued") return [];
return job.items.filter(
(item) =>
(item.state === "failed" &&
!item.error?.startsWith("Server restarted during import.")) ||
((job.state === "interrupted" || job.state === "cancelled") &&
(item.state === "pending" || item.state === "cancelled")),
);
}