From a053d9b87e9799b151e2563b499dbff309b9d2e5 Mon Sep 17 00:00:00 2001 From: adi_holden Date: Tue, 28 May 2024 10:50:40 +0300 Subject: [PATCH] fix: extendlock,createbulk use pipeline no multi command Signed-off-by: adi_holden --- src/classes/job.ts | 6 +++--- src/classes/worker.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classes/job.ts b/src/classes/job.ts index 4e9dd3a75c..8fefc034f6 100644 --- a/src/classes/job.ts +++ b/src/classes/job.ts @@ -256,10 +256,10 @@ export class Job< new this(queue, job.name, job.data, job.opts, job.opts?.jobId), ); - const multi = client.multi(); + const pipeline = client.pipeline(); for (const job of jobInstances) { - job.addJob((multi as unknown), { + job.addJob((pipeline as unknown), { parentKey: job.parentKey, parentDependenciesKey: job.parentKey ? `${job.parentKey}:dependencies` @@ -267,7 +267,7 @@ export class Job< }); } - const results = (await multi.exec()) as [null | Error, string][]; + const results = (await pipeline.exec()) as [null | Error, string][]; for (let index = 0; index < results.length; ++index) { const [err, id] = results[index]; if (err) { diff --git a/src/classes/worker.ts b/src/classes/worker.ts index f3bce72c8a..e684a8aacf 100644 --- a/src/classes/worker.ts +++ b/src/classes/worker.ts @@ -1004,16 +1004,16 @@ will never work with more accuracy than 1ms. */ protected async extendLocks(jobs: Job[]) { try { - const multi = (await this.client).multi(); + const pipeline = (await this.client).pipeline(); for (const job of jobs) { await this.scripts.extendLock( job.id, job.token, this.opts.lockDuration, - multi, + pipeline, ); } - const result = (await multi.exec()) as [Error, string][]; + const result = (await pipeline.exec()) as [Error, string][]; for (const [err, jobId] of result) { if (err) {