import type { CleanupResult, JobMaintenance, RecoveredJob } from '../ports/jobMaintenance.js'; import type { JobRequests } from '../ports/jobRequests.js'; import type { Logger } from '../ports/logger.js'; /** The sentence the admin reads on a job the recovery has interrupted. */ export declare function recoveredMessage(deadAfterMs: number): string; /** * The recovery cron (`importRecover`, § 8.4): a worker that has not written its * heartbeat for 2 minutes is dead, and its job is `interrupted`, which frees the * place of the one import at a time. Safe to run on every instance at once. */ export declare function recoverDeadJobs(deps: { maintenance: Pick; logger: Logger; }): Promise; export interface DispatchReport { /** Requests written. */ asked: number; /** Waiting jobs that already had a request on its way. */ inFlight: number; /** Requests that could not be written. */ failed: number; } /** * The dispatch cron (`importDispatch`, § 8.4): asks again for a worker for each * job that has waited more than 30 seconds in `uploaded` or `queued`, because * an event can be lost, delayed behind a long queue, or dropped by an instance * that was full. A job that already has a request on its way is left alone, or * a queue of events that is slow to drain would fill up with copies of it. A * second request that does get through starts a worker that finds the job * claimed and ends quietly, so being too eager is harmless. */ export declare function dispatchWaitingJobs(deps: { maintenance: Pick; requests: JobRequests; logger: Logger; }): Promise; /** * The cleanup cron (`importCleanup`, § 8.4): removes what nobody will use again * (an upload that stopped, a job past its retention, the file of a job that * ended clean). */ export declare function cleanUpJobs(deps: { maintenance: Pick; logger: Logger; }): Promise;