Skip to content

Commit 8c1f1c4

Browse files
bumped io-redis to 5.6.0
1 parent 9a2efa6 commit 8c1f1c4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

js/ioredis/lib/subscriber.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ async function subscriberRoutine(
3131
}
3232
totalSubscribedRef.value -= channels.slice(1).length;
3333
}
34-
// Duplicate connection afresh.
35-
pubsub = client.duplicate();
36-
} else {
37-
pubsub = client.duplicate();
34+
// Close existing connection before creating new one
35+
await pubsub.quit();
3836
}
3937

38+
// Duplicate connection afresh.
39+
// For cluster clients, duplicate() creates a new cluster-aware client
40+
pubsub = client.duplicate();
41+
4042
// Set up error logging.
4143
pubsub.on('error', (err) => {
4244
console.error(`[${clientName}] Redis error: ${err.message}`);

js/ioredis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"cluster-key-slot": "^1.1.0",
88
"hdr-histogram-js": "^2.0.1",
9-
"ioredis": "^4.30.0",
9+
"ioredis": "^5.6.0",
1010
"seedrandom": "^3.0.5",
1111
"yargs": "^17.7.2"
1212
},

0 commit comments

Comments
 (0)