Skip to content

fix(client): make socket.host not required #3024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/client/lib/client/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type RedisTcpOptions = RedisSocketOptionsCommon & NetOptions & Omit<

type RedisTlsOptions = RedisSocketOptionsCommon & tls.ConnectionOptions & {
tls: true;
host: string;
}

type RedisIpcOptions = RedisSocketOptionsCommon & Omit<
Expand Down Expand Up @@ -238,7 +237,7 @@ export default class RedisSocket extends EventEmitter {
}
} while (this.#isOpen && !this.#isReady);
}

async #createSocket(): Promise<net.Socket | tls.TLSSocket> {
const socket = this.#socketFactory.create();

Expand Down Expand Up @@ -293,7 +292,7 @@ export default class RedisSocket extends EventEmitter {

write(iterable: Iterable<ReadonlyArray<RedisArgument>>) {
if (!this.#socket) return;

this.#socket.cork();
for (const args of iterable) {
for (const toWrite of args) {
Expand Down Expand Up @@ -364,7 +363,7 @@ export default class RedisSocket extends EventEmitter {
const jitter = Math.floor(Math.random() * 200);
// Delay is an exponential back off, (times^2) * 50 ms, with a maximum value of 2000 ms:
const delay = Math.min(Math.pow(2, retries) * 50, 2000);

return delay + jitter;
}
}
Loading