Skip to content

Commit d9b1bf1

Browse files
authored
fix: Fix db parameter not working with auto pipelining (redis#1721)
1 parent fe52ff1 commit d9b1bf1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/autoPipelining.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const notAllowedAutoPipelineCommands = [
1717
"psubscribe",
1818
"unsubscribe",
1919
"unpsubscribe",
20+
"select",
2021
];
2122

2223
function executeAutoPipeline(client, slotKey: string) {

test/functional/autopipelining.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ describe("autoPipelining for single node", () => {
3131
await promises;
3232
});
3333

34+
it("should work with db parameter", async () => {
35+
const redis = new Redis({ enableAutoPipelining: true, db: 1 });
36+
37+
redis.set("foo", "bar");
38+
await new Promise((resolve) => {
39+
redis.once("ready", resolve);
40+
});
41+
expect(await redis.get("foo")).to.eql("bar");
42+
});
43+
3444
it("should not add blacklisted commands to auto pipelines", async () => {
3545
const redis = new Redis({
3646
enableAutoPipelining: true,

0 commit comments

Comments
 (0)