Skip to content

Commit

Permalink
fix: Fix db parameter not working with auto pipelining (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
luin authored Feb 12, 2023
1 parent fe52ff1 commit d9b1bf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/autoPipelining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const notAllowedAutoPipelineCommands = [
"psubscribe",
"unsubscribe",
"unpsubscribe",
"select",
];

function executeAutoPipeline(client, slotKey: string) {
Expand Down
10 changes: 10 additions & 0 deletions test/functional/autopipelining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ describe("autoPipelining for single node", () => {
await promises;
});

it("should work with db parameter", async () => {
const redis = new Redis({ enableAutoPipelining: true, db: 1 });

redis.set("foo", "bar");
await new Promise((resolve) => {
redis.once("ready", resolve);
});
expect(await redis.get("foo")).to.eql("bar");
});

it("should not add blacklisted commands to auto pipelines", async () => {
const redis = new Redis({
enableAutoPipelining: true,
Expand Down

0 comments on commit d9b1bf1

Please sign in to comment.