File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,8 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
216
216
217
217
if ( promises . length ) {
218
218
this . #tick( ) ;
219
+ await Promise . all ( promises ) ;
219
220
}
220
-
221
- await Promise . all ( promises ) ;
222
221
} ;
223
222
224
223
return new RedisSocket ( socketInitiator , this . #options?. socket )
@@ -318,9 +317,9 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
318
317
}
319
318
320
319
// using `#sendCommand` cause `sendCommand` is overwritten in legacy mode
321
- async #sendCommand< T = RedisCommandRawReply > ( args : RedisCommandArguments , options ?: ClientCommandOptions , bufferMode ?: boolean ) : Promise < T > {
320
+ #sendCommand< T = RedisCommandRawReply > ( args : RedisCommandArguments , options ?: ClientCommandOptions , bufferMode ?: boolean ) : Promise < T > {
322
321
if ( ! this . #socket. isOpen ) {
323
- throw new ClientClosedError ( ) ;
322
+ return Promise . reject ( new ClientClosedError ( ) ) ;
324
323
}
325
324
326
325
if ( options ?. isolated ) {
@@ -334,7 +333,7 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
334
333
335
334
const promise = this . #queue. addCommand < T > ( args , options , bufferMode ) ;
336
335
this . #tick( ) ;
337
- return await promise ;
336
+ return promise ;
338
337
}
339
338
340
339
async scriptsExecutor ( script : RedisScript , args : Array < unknown > ) : Promise < RedisCommandReply < typeof script > > {
You can’t perform that action at this time.
0 commit comments