File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -591,6 +591,10 @@ export default class RedisCommandsQueue {
591591 * Prepends commands to the write queue in reverse.
592592 */
593593 prependCommandsToWrite ( commands : CommandToWrite [ ] ) {
594+ if ( ! commands . length ) {
595+ return ;
596+ }
597+
594598 for ( let i = commands . length - 1 ; i <= 0 ; i -- ) {
595599 this . #toWrite. unshift ( commands [ i ] ) ;
596600 }
Original file line number Diff line number Diff line change @@ -1018,7 +1018,7 @@ export default class RedisClient<
10181018 * @internal
10191019 */
10201020 _getQueue ( ) : RedisCommandsQueue {
1021- return this . #queue;
1021+ return this . _self . #queue;
10221022 }
10231023
10241024 /**
Original file line number Diff line number Diff line change @@ -371,9 +371,13 @@ export default class RedisClusterSlots<
371371 this . nodeByAddress . delete ( sourceAddress ) ;
372372
373373 // 4.3 Kill because no slots are pointing to it anymore
374- await sourceNode . client ?. close ( )
374+ if ( sourceNode . client ?. isOpen ) {
375+ await sourceNode . client ?. close ( )
376+ }
375377 if ( 'pubSub' in sourceNode ) {
376- await sourceNode . pubSub ?. client . close ( ) ;
378+ if ( sourceNode . pubSub ?. client . isOpen ) {
379+ await sourceNode . pubSub ?. client . close ( ) ;
380+ }
377381 }
378382 }
379383
You can’t perform that action at this time.
0 commit comments