check for null jobs in QueueService.queueGetJobs

This commit is contained in:
Hazelnoot 2025-06-26 14:20:03 -04:00
parent ed68230811
commit 4346bac05f

View file

@ -879,7 +879,7 @@ export class QueueService {
public async queueGetJobs(queueType: typeof QUEUE_TYPES[number], jobTypes: JobType[], search?: string) {
const RETURN_LIMIT = 100;
const queue = this.getQueue(queueType);
let jobs: Bull.Job[];
let jobs: (Bull.Job | null)[];
if (search) {
jobs = await queue.getJobs(jobTypes, 0, 1000);
@ -896,7 +896,9 @@ export class QueueService {
jobs = await queue.getJobs(jobTypes, 0, RETURN_LIMIT);
}
return jobs.map(job => this.packJobData(job));
return jobs
.filter(job => job != null) // not sure how this happens, but it does
.map(job => this.packJobData(job));
}
@bindThis