Skip to content

Commit

Permalink
fix: remove allowCompletedRetries from public option interface
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Jan 3, 2023
1 parent 139fcd4 commit c96658f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/api/src/queueAdapters/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export abstract class BaseAdapter {
public readonly description: string;
private formatters = new Map<FormatterField, (data: any) => any>();

protected constructor(options: Partial<QueueAdapterOptions> = {}) {
protected constructor(
options: Partial<QueueAdapterOptions & { allowCompletedRetries: boolean }> = {}
) {
this.readOnlyMode = options.readOnlyMode === true;
this.allowRetries = this.readOnlyMode ? false : options.allowRetries !== false;
this.allowCompletedRetries = this.allowRetries && options.allowCompletedRetries !== false;
Expand Down
5 changes: 1 addition & 4 deletions packages/api/src/queueAdapters/bull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BaseAdapter } from './base';

export class BullAdapter extends BaseAdapter {
constructor(public queue: Queue, options: Partial<QueueAdapterOptions> = {}) {
options.allowCompletedRetries = false; // bull doesn't support this
super(options);
super({ ...options, allowCompletedRetries: false });
}

public getRedisInfo(): Promise<string> {
Expand Down Expand Up @@ -66,5 +65,3 @@ export class BullAdapter extends BaseAdapter {
return this.queue.empty();
}
}


1 change: 0 additions & 1 deletion packages/api/typings/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export type JobCounts = Record<Status, number>;
export interface QueueAdapterOptions {
readOnlyMode: boolean;
allowRetries: boolean;
allowCompletedRetries: boolean;
prefix: string;
description: string;
}
Expand Down

0 comments on commit c96658f

Please sign in to comment.