Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Aug 8, 2023
1 parent 573e4de commit 4f06cac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/api/src/queueAdapters/bullMQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { STATUSES } from '../constants/statuses';
import { BaseAdapter } from './base';

export class BullMQAdapter extends BaseAdapter {
private readonly LIMIT = 1000;

constructor(private queue: Queue, options: Partial<QueueAdapterOptions> = {}) {
super(options);
}
Expand All @@ -19,8 +17,8 @@ export class BullMQAdapter extends BaseAdapter {
return `${this.prefix}${this.queue.name}`;
}

public clean(jobStatus: JobCleanStatus, graceTimeMs: number): Promise<void> {
return this.queue.clean(graceTimeMs, this.LIMIT, jobStatus).then(() => undefined);
public async clean(jobStatus: JobCleanStatus, graceTimeMs: number): Promise<void> {
await this.queue.clean(graceTimeMs, 1000, jobStatus);
}

public getJob(id: string): Promise<Job | undefined> {
Expand Down

0 comments on commit 4f06cac

Please sign in to comment.