File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ export class NotebookController {
62
62
private _port : undefined | number ;
63
63
private _process : undefined | ChildProcess ;
64
64
private _websocket : undefined | WebSocket ;
65
+ private _timeout : undefined | NodeJS . Timeout ;
65
66
private _client : undefined | Client ;
66
67
private _clientWaiters : {
67
68
resolve : ( client : Client ) => void ;
@@ -185,11 +186,14 @@ export class NotebookController {
185
186
return ;
186
187
}
187
188
log . info ( `ws close` ) ;
188
- setTimeout ( ( ) => {
189
- if ( this . _state === "connecting" || this . _state === "connected" ) {
190
- this . run ( "started" ) ;
191
- }
192
- } , RECONNECT_INTERVAL ) ;
189
+ if ( ! this . _timeout ) {
190
+ this . _timeout = setTimeout ( ( ) => {
191
+ this . _timeout = undefined ;
192
+ if ( this . _state === "connecting" || this . _state === "connected" ) {
193
+ this . run ( "started" ) ;
194
+ }
195
+ } , RECONNECT_INTERVAL ) ;
196
+ }
193
197
} ) ;
194
198
}
195
199
You can’t perform that action at this time.
0 commit comments