Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a committed Nov 4, 2024
1 parent 503e59f commit 82918d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion experimental/cluster/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class ClusterExecutor implements CommandExecutor {
async #closeExistingConnection() {
const nodeNames = Object.keys(this.#connectionByNodeName);
while (nodeNames.length >= this.#maxConnections) {
const nodeName = sample(nodeNames);
const nodeName = sample(nodeNames)!;
const conn = this.#connectionByNodeName[nodeName];
delete this.#connectionByNodeName[nodeName];
try {
Expand Down
4 changes: 2 additions & 2 deletions tests/cluster/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe("experimental/cluster", () => {
const slot = calculateSlot(key);
manuallyRedirectedPort = sample(
ports.filter((x) => x !== opts.port),
);
)!;
const error = new ErrorReplyError(
`-MOVED ${slot} ${opts.hostname}:${manuallyRedirectedPort}`,
);
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("experimental/cluster", () => {
const slot = calculateSlot(key);
manuallyRedirectedPort = sample(
ports.filter((x) => x !== opts.port),
);
)!;
const error = new ErrorReplyError(
`-ASK ${slot} ${opts.hostname}:${manuallyRedirectedPort}`,
);
Expand Down

0 comments on commit 82918d1

Please sign in to comment.