Skip to main content

InspectableJobQueueStrategy

InspectableJobQueueStrategy

Defines a job queue strategy that can be inspected using the default admin ui

Signature
interface InspectableJobQueueStrategy extends JobQueueStrategy {
findOne(id: ID): Promise<Job | undefined>;
findMany(options?: JobListOptions): Promise<PaginatedList<Job>>;
findManyById(ids: ID[]): Promise<Job[]>;
removeSettledJobs(queueNames?: string[], olderThan?: Date): Promise<number>;
cancelJob(jobId: ID): Promise<Job | undefined>;
}

findOne

method
(id: ID) => Promise<Job | undefined>

Returns a job by its id.

findMany

method
(options?: JobListOptions) => Promise<PaginatedList<Job>>

Returns a list of jobs according to the specified options.

findManyById

method
(ids: ID[]) => Promise<Job[]>

Returns an array of jobs for the given ids.

removeSettledJobs

method
(queueNames?: string[], olderThan?: Date) => Promise<number>

Remove all settled jobs in the specified queues older than the given date. If no queueName is passed, all queues will be considered. If no olderThan date is passed, all jobs older than the current time will be removed.

Returns a promise of the number of jobs removed.

cancelJob

method
(jobId: ID) => Promise<Job | undefined>