fix(server): add paused property to JobCountsDto (#2112)

This commit is contained in:
Michel Heusschen
2023-03-29 17:33:03 +02:00
committed by GitHub
parent 76a07a3ebc
commit eda9e580c9
11 changed files with 45 additions and 65 deletions

View File

@@ -10,7 +10,7 @@ import {
} from '@app/domain';
import { InjectQueue } from '@nestjs/bull';
import { Logger } from '@nestjs/common';
import { Queue } from 'bull';
import { Queue, type JobCounts as BullJobCounts } from 'bull';
export class JobRepository implements IJobRepository {
private logger = new Logger(JobRepository.name);
@@ -54,7 +54,9 @@ export class JobRepository implements IJobRepository {
}
getJobCounts(name: QueueName): Promise<JobCounts> {
return this.queueMap[name].getJobCounts();
// Typecast needed because the `paused` key is missing from Bull's
// type definition. Can be removed once fixed upstream.
return this.queueMap[name].getJobCounts() as Promise<BullJobCounts & { paused: number }>;
}
async queue(item: JobItem): Promise<void> {