Skip to content

Commit 9438c8c

Browse files
committed
fix: test broken
1 parent d0acec0 commit 9438c8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class Api {
285285
})
286286
}
287287
tasks.length > 0 && logWorker('Accepted tasks ', { tasks })
288-
await this.redis.expire(this.workerSetName, 60 * 5)
288+
if (this.redis.isOpen) await this.redis.expire(this.workerSetName, 60 * 5)
289289
let reclaimCounts = 0
290290
await promise.all(tasks.map(async task => {
291291
const streamlen = await this.redis.xLen(task.stream)
@@ -385,6 +385,7 @@ export class Worker {
385385
}
386386

387387
async checkAndRecoverOrphanStreams () {
388+
if (!this.client.redis.isOpen) return
388389
const rawConsumers = await this.client.redis.xInfoConsumers(
389390
this.client.redisWorkerStreamName,
390391
this.client.redisWorkerGroupName

0 commit comments

Comments
 (0)