File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/data-service/src Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ export type ExplainExecuteOptions = ExecutionOptions & {
138
138
export interface DataServiceEventMap {
139
139
topologyDescriptionChanged : ( evt : TopologyDescriptionChangedEvent ) => void ;
140
140
connectionInfoSecretsChanged : ( ) => void ;
141
+ close : ( ) => void ;
141
142
}
142
143
143
144
export type UpdatePreviewChange = {
@@ -1017,7 +1018,7 @@ class DataServiceImpl extends WithLogContext implements DataService {
1017
1018
}
1018
1019
1019
1020
once ( ...args : Parameters < DataService [ 'on' ] > ) {
1020
- this . _emitter . on ( ...args ) ;
1021
+ this . _emitter . once ( ...args ) ;
1021
1022
return this ;
1022
1023
}
1023
1024
@@ -2276,6 +2277,11 @@ class DataServiceImpl extends WithLogContext implements DataService {
2276
2277
} ) ;
2277
2278
} ) ;
2278
2279
2280
+ client . on ( 'close' , ( ) => {
2281
+ this . _logger . info ( mongoLogId ( 1_001_000_315 ) , 'Client is closed' ) ;
2282
+ this . _emitter . emit ( 'close' ) ;
2283
+ } ) ;
2284
+
2279
2285
client . on ( 'serverClosed' , ( evt : ServerClosedEvent ) => {
2280
2286
this . _logger . info ( mongoLogId ( 1_001_000_020 ) , 'Server closed' , {
2281
2287
address : evt . address ,
You can’t perform that action at this time.
0 commit comments