File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/client/lib/sentinel Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -928,6 +928,16 @@ class RedisSentinelInternal<
928
928
}
929
929
}
930
930
931
+ #handleSentinelFailure( node : RedisNode ) {
932
+ const found = this . #sentinelRootNodes. findIndex (
933
+ ( rootNode ) => rootNode . host === node . host && rootNode . port === node . port
934
+ ) ;
935
+ if ( found !== - 1 ) {
936
+ this . #sentinelRootNodes. splice ( found , 1 ) ;
937
+ }
938
+ this . #reset( ) ;
939
+ }
940
+
931
941
async close ( ) {
932
942
this . #destroy = true ;
933
943
@@ -1197,8 +1207,9 @@ class RedisSentinelInternal<
1197
1207
error : err
1198
1208
} ;
1199
1209
this . emit ( 'client-error' , event ) ;
1200
- this . #reset( ) ;
1201
- } ) ;
1210
+ this . #handleSentinelFailure( node ) ;
1211
+ } )
1212
+ . on ( 'end' , ( ) => this . #handleSentinelFailure( node ) ) ;
1202
1213
this . #sentinelClient = client ;
1203
1214
1204
1215
this . #trace( `transform: adding sentinel client connect() to promise list` ) ;
You can’t perform that action at this time.
0 commit comments