File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
packages/client/lib/client Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export default class RedisCommandsQueue {
87
87
this . #maintenanceCommandTimeout = ms ;
88
88
89
89
let counter = 0 ;
90
+ const total = this . #toWrite. length ;
90
91
91
92
// Overwrite timeouts of all eligible toWrite commands
92
93
for ( const node of this . #toWrite. nodes ( ) ) {
@@ -114,7 +115,7 @@ export default class RedisCommandsQueue {
114
115
} ;
115
116
signal . addEventListener ( 'abort' , command . timeout . listener , { once : true } ) ;
116
117
} ;
117
- dbgMaintenance ( `Total of ${ counter } timeouts reset to ${ ms } ` ) ;
118
+ dbgMaintenance ( `Total of ${ counter } of ${ total } timeouts reset to ${ ms } ` ) ;
118
119
}
119
120
120
121
get isPubSubActive ( ) {
Original file line number Diff line number Diff line change @@ -181,18 +181,24 @@ export default class EnterpriseMaintenanceManager {
181
181
dbgMaintenance ( "Pausing writing of new commands to old socket" ) ;
182
182
this . #client. _pause ( ) ;
183
183
184
+ dbgMaintenance ( "Creating new tmp client" ) ;
185
+ let start = performance . now ( ) ;
184
186
const tmpClient = this . #client. duplicate ( {
185
- maintPushNotifications : "disabled" ,
186
187
socket : {
187
188
...this . #options. socket ,
188
189
host,
189
190
port,
190
191
} ,
191
192
} ) ;
192
-
193
+ dbgMaintenance ( `Tmp client created in ${ ( performance . now ( ) - start ) . toFixed ( 2 ) } ms` ) ;
193
194
dbgMaintenance ( `Connecting tmp client: ${ host } :${ port } ` ) ;
195
+ start = performance . now ( ) ;
196
+ tmpClient . _maintenanceUpdate ( {
197
+ relaxedCommandTimeout : this . #options. maintRelaxedCommandTimeout ,
198
+ relaxedSocketTimeout : this . #options. maintRelaxedSocketTimeout ,
199
+ } ) ;
194
200
await tmpClient . connect ( ) ;
195
- dbgMaintenance ( `Connected to tmp client` ) ;
201
+ dbgMaintenance ( `Connected to tmp client in ${ ( performance . now ( ) - start ) . toFixed ( 2 ) } ms ` ) ;
196
202
// 3 [EVENT] New socket connected
197
203
198
204
//TODO
Original file line number Diff line number Diff line change @@ -937,7 +937,7 @@ export default class RedisClient<
937
937
_ejectSocket ( ) : RedisSocket {
938
938
const socket = this . _self . #socket;
939
939
// @ts -ignore
940
- this . #socket = null ;
940
+ this . _self . #socket = null ;
941
941
socket . removeAllListeners ( ) ;
942
942
return socket ;
943
943
}
@@ -957,10 +957,10 @@ export default class RedisClient<
957
957
* @internal
958
958
*/
959
959
_maintenanceUpdate ( update : MaintenanceUpdate ) {
960
- this . #socket. inMaintenance = update . inMaintenance ;
961
- this . #socket. setMaintenanceTimeout ( update . relaxedSocketTimeout ) ;
962
- this . #queue. inMaintenance = update . inMaintenance ;
963
- this . #queue. setMaintenanceCommandTimeout ( update . relaxedCommandTimeout ) ;
960
+ this . _self . #socket. inMaintenance = update . inMaintenance ;
961
+ this . _self . #socket. setMaintenanceTimeout ( update . relaxedSocketTimeout ) ;
962
+ this . _self . #queue. inMaintenance = update . inMaintenance ;
963
+ this . _self . #queue. setMaintenanceCommandTimeout ( update . relaxedCommandTimeout ) ;
964
964
}
965
965
966
966
/**
You can’t perform that action at this time.
0 commit comments