diff --git a/lib/cluster-slots.ts b/lib/cluster-slots.ts index 4c33f2e0f7..29730bf753 100644 --- a/lib/cluster-slots.ts +++ b/lib/cluster-slots.ts @@ -1,6 +1,5 @@ import calculateSlot from 'cluster-key-slot'; import RedisClient, { RedisClientType } from './client'; -import { RedisSocketOptions } from './socket'; import { RedisClusterMasterNode, RedisClusterReplicaNode } from './commands/CLUSTER_NODES'; import { RedisClusterClientOptions, RedisClusterOptions } from './cluster'; import { RedisModules } from './commands'; @@ -32,7 +31,7 @@ export default class RedisClusterSlots { for (const rootNode of this.#options.rootNodes) { - if (await this.#discoverNodes(rootNode)) return; + if (await this.#discoverNodes(this.#clientOptionsDefaults(rootNode))) return; } throw new Error('None of the root nodes is available'); @@ -99,6 +98,18 @@ export default class RedisClusterSlots, promises: Array>): ClusterNode { const url = `${nodeData.host}:${nodeData.port}`; clientsInUse.add(url); @@ -107,13 +118,15 @@ export default class RedisClusterSlots, 'module export interface RedisClusterOptions { rootNodes: Array; - defaults?: RedisClusterClientOptions; + defaults?: Partial; modules?: M; scripts?: S; useReplicas?: boolean;