web / lib/jobs/handlers/cleanup-stuck-scheduled-imports-job
lib/jobs/handlers/cleanup-stuck-scheduled-imports-job
Job handler for cleaning up stuck scheduled imports.
Identifies and resets scheduled imports that have been stuck in “running” status for too long (default 2 hours). This prevents permanent blocking of scheduled imports due to job failures or system crashes.
Interfaces
CleanupStuckScheduledImportsJobInput
Properties
stuckThresholdHours?
optionalstuckThresholdHours:number
Hours after which a running import is considered stuck (default: 2)
dryRun?
optionaldryRun:boolean
Whether to run in dry-run mode (default: false)
Variables
cleanupStuckScheduledImportsJob
constcleanupStuckScheduledImportsJob:object
Type declaration
slug
slug:
string="cleanup-stuck-scheduled-imports"
handler()
handler: (
context) =>Promise<{output: {success:boolean;totalRunning:number;stuckCount:number;resetCount:number;dryRun:boolean;errors:undefined|object[]; }; }>
Parameters
context
Returns
Promise<{ output: { success: boolean; totalRunning: number; stuckCount: number; resetCount: number; dryRun: boolean; errors: undefined | object[]; }; }>