Skip to content

Commit

Permalink
fix(queue): use QueueOptions type in opts attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Mar 21, 2024
1 parent a73cf32 commit cfa1e55
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/classes/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export class Queue<
> extends QueueGetters<DataType, ResultType, NameType> {
token = v4();
jobsOpts: BaseJobOptions;
opts: QueueOptions;
private _repeat?: Repeat;

constructor(
Expand All @@ -116,11 +117,7 @@ export class Queue<
this.waitUntilReady()
.then(client => {
if (!this.closing) {
client.hset(
this.keys.meta,
'opts.maxLenEvents',
opts?.streams?.events?.maxLen ?? 10000,
);
client.hmset(this.keys.meta, this.metaValues);
}
})
.catch(err => {
Expand Down Expand Up @@ -167,6 +164,12 @@ export class Queue<
return { ...this.jobsOpts };
}

get metaValues(): Record<string, string | number> {
return {
'opts.maxLenEvents': this.opts?.streams?.events?.maxLen ?? 10000,
};
}

get repeat(): Promise<Repeat> {
return new Promise<Repeat>(async resolve => {
if (!this._repeat) {
Expand Down

0 comments on commit cfa1e55

Please sign in to comment.