Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.
ReferenceAPI ReferenceLibraryJobsHandlersCleanup Stuck Scheduled Ingests Job

web


web / lib/jobs/handlers/cleanup-stuck-scheduled-ingests-job

lib/jobs/handlers/cleanup-stuck-scheduled-ingests-job

Job handler for cleaning up stuck scheduled ingests.

Identifies and resets scheduled ingests that have been stuck in “running” status for too long (default 4 hours). The threshold is intentionally generous because lastRun records the trigger/queue time, not when processing actually started — there can be significant delay due to queue backlog or worker restarts.

Before resetting, also checks whether a Payload job is still actively processing the ingest to avoid killing in-progress work.

Interfaces

CleanupStuckScheduledIngestsJobInput

Properties

stuckThresholdHours?

optional stuckThresholdHours?: number

Hours after which a running import is considered stuck (default: 4). Uses 4h because lastRun is the trigger time, not when processing started.

dryRun?

optional dryRun?: boolean

Whether to run in dry-run mode (default: false)

Variables

cleanupStuckScheduledIngestsJob

const cleanupStuckScheduledIngestsJob: object

Type Declaration

slug

slug: string = "cleanup-stuck-scheduled-ingests"

schedule

schedule: object[]

concurrency

concurrency: () => string

Returns

string

handler

handler: (context) => Promise<{ output: \{ success: boolean; totalRunning: number; stuckCount: number; resetCount: number; dryRun: boolean; errors: object[] \| undefined; }; }>

Parameters
context

JobHandlerContext

Returns

Promise<{ output: \{ success: boolean; totalRunning: number; stuckCount: number; resetCount: number; dryRun: boolean; errors: object[] \| undefined; }; }>

Last updated on