Skip to content

Commit

Permalink
fix createCluster - copy options.defaults.socket before modifying it (
Browse files Browse the repository at this point in the history
#2783)

* shallow copy of this.#options.defaults.socket

* shallow copy of this.#options.defaults.socket

* nit

---------

Co-authored-by: Max Gruenfelder <[email protected]>
Co-authored-by: Leibale Eidelman <[email protected]>
  • Loading branch information
3 people authored Jul 2, 2024
1 parent d5355d4 commit 4ac97ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/client/lib/cluster/cluster-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ export default class RedisClusterSlots<
if (this.#options.defaults) {
let socket;
if (this.#options.defaults.socket) {
socket = options?.socket ? {
socket = {
...this.#options.defaults.socket,
...options.socket
} : this.#options.defaults.socket;
...options?.socket
};
} else {
socket = options?.socket;
}
Expand Down

0 comments on commit 4ac97ee

Please sign in to comment.