fix type error
This commit is contained in:
parent
c95fbb83a5
commit
bc8e44e2d8
|
@ -756,8 +756,8 @@ export class QueueService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async queueRetryJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
public async queueRetryJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||||
const queue = this.getQueue(queueType);
|
const queue = this.getQueue(queueType);
|
||||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
const job = await queue.getJob(jobId);
|
||||||
if (job) {
|
if (job != null) {
|
||||||
if (job.finishedOn != null) {
|
if (job.finishedOn != null) {
|
||||||
await job.retry();
|
await job.retry();
|
||||||
} else {
|
} else {
|
||||||
|
@ -769,8 +769,8 @@ export class QueueService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async queueRemoveJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
public async queueRemoveJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||||
const queue = this.getQueue(queueType);
|
const queue = this.getQueue(queueType);
|
||||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
const job = await queue.getJob(jobId);
|
||||||
if (job) {
|
if (job != null) {
|
||||||
await job.remove();
|
await job.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -803,8 +803,8 @@ export class QueueService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async queueGetJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
public async queueGetJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||||
const queue = this.getQueue(queueType);
|
const queue = this.getQueue(queueType);
|
||||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
const job = await queue.getJob(jobId);
|
||||||
if (job) {
|
if (job != null) {
|
||||||
return this.packJobData(job);
|
return this.packJobData(job);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Job not found: ${jobId}`);
|
throw new Error(`Job not found: ${jobId}`);
|
||||||
|
|
Loading…
Reference in New Issue