From 30aab18f3ac9fb6b87cb3b560b6fa8f4f78570e3 Mon Sep 17 00:00:00 2001 From: roggervalf Date: Wed, 20 Mar 2024 22:59:08 -0500 Subject: [PATCH] fix(queue): use QueueOptions type in opts attribute --- src/classes/queue.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/classes/queue.ts b/src/classes/queue.ts index 16ef4c728d..9326f77f21 100644 --- a/src/classes/queue.ts +++ b/src/classes/queue.ts @@ -95,6 +95,7 @@ export class Queue< > extends QueueGetters { token = v4(); jobsOpts: BaseJobOptions; + opts: QueueOptions; private _repeat?: Repeat; constructor( @@ -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 => { @@ -167,6 +164,12 @@ export class Queue< return { ...this.jobsOpts }; } + get metaValues(): Record { + return { + 'opts.maxLenEvents': this.opts?.streams?.events?.maxLen ?? 10000, + }; + } + get repeat(): Promise { return new Promise(async resolve => { if (!this._repeat) {