@@ -6,6 +6,7 @@ import { setTimeout } from 'node:timers/promises';
66// import { ClusterSlotsReply } from '@redis/client/dist/lib/commands/CLUSTER_SLOTS';
77import { promisify } from 'node:util' ;
88import { exec } from 'node:child_process' ;
9+
910const execAsync = promisify ( exec ) ;
1011
1112interface ErrorWithCode extends Error {
@@ -135,10 +136,10 @@ async function spawnRedisClusterNodeDockers(
135136 '5000'
136137 ] , clientConfig ) . then ( async replica => {
137138
138- const requirePassIndex = serverArguments . findIndex ( ( x ) => x === '--requirepass' ) ;
139- if ( requirePassIndex !== - 1 ) {
140- const password = serverArguments [ requirePassIndex + 1 ] ;
141- await replica . client . configSet ( { 'masterauth' : password } )
139+ const requirePassIndex = serverArguments . findIndex ( ( x ) => x === '--requirepass' ) ;
140+ if ( requirePassIndex !== - 1 ) {
141+ const password = serverArguments [ requirePassIndex + 1 ] ;
142+ await replica . client . configSet ( { 'masterauth' : password } )
142143 }
143144 await replica . client . clusterMeet ( '127.0.0.1' , master . docker . port ) ;
144145
@@ -227,7 +228,7 @@ async function spawnRedisClusterDockers(
227228 while (
228229 totalNodes ( await client . clusterSlots ( ) ) !== nodes . length ||
229230 ! ( await client . sendCommand < string > ( [ 'CLUSTER' , 'INFO' ] ) ) . startsWith ( 'cluster_state:ok' ) // TODO
230- ) {
231+ ) {
231232 await setTimeout ( 50 ) ;
232233 }
233234
@@ -260,7 +261,7 @@ export function spawnRedisCluster(
260261 return runningCluster ;
261262 }
262263
263- const dockersPromise = spawnRedisClusterDockers ( dockersConfig , serverArguments , clientConfig ) ;
264+ const dockersPromise = spawnRedisClusterDockers ( dockersConfig , serverArguments , clientConfig ) ;
264265
265266 RUNNING_CLUSTERS . set ( serverArguments , dockersPromise ) ;
266267 return dockersPromise ;
0 commit comments