File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ export enum HeartbeatConstants {
392
392
* The duration between heartbeats
393
393
*/
394
394
BeatInterval = 5000 ,
395
+ /**
396
+ * The duration of the first heartbeat while the pty host is starting up. This is much larger
397
+ * than the regular BeatInterval to accomodate slow machines, we still want to warn about the
398
+ * pty host's unresponsiveness eventually though.
399
+ */
400
+ ConnectingBeatInterval = 20000 ,
395
401
/**
396
402
* Defines a multiplier for BeatInterval for how long to wait before starting the second wait
397
403
* timer.
Original file line number Diff line number Diff line change @@ -149,8 +149,7 @@ export class PtyHostService extends Disposable implements IPtyService {
149
149
// Setup heartbeat service and trigger a heartbeat immediately to reset the timeouts
150
150
const heartbeatService = ProxyChannel . toService < IHeartbeatService > ( client . getChannel ( TerminalIpcChannels . Heartbeat ) ) ;
151
151
heartbeatService . onBeat ( ( ) => this . _handleHeartbeat ( ) ) ;
152
- // TODO: Starting the heartbeat tracking now causes problems
153
- this . _handleHeartbeat ( ) ;
152
+ this . _handleHeartbeat ( true ) ;
154
153
155
154
// Handle exit
156
155
this . _register ( connection . onDidProcessExit ( e => {
@@ -351,9 +350,9 @@ export class PtyHostService extends Disposable implements IPtyService {
351
350
this . _connection . store . dispose ( ) ;
352
351
}
353
352
354
- private _handleHeartbeat ( ) {
353
+ private _handleHeartbeat ( isConnecting ?: boolean ) {
355
354
this . _clearHeartbeatTimeouts ( ) ;
356
- this . _heartbeatFirstTimeout = setTimeout ( ( ) => this . _handleHeartbeatFirstTimeout ( ) , HeartbeatConstants . BeatInterval * HeartbeatConstants . FirstWaitMultiplier ) ;
355
+ this . _heartbeatFirstTimeout = setTimeout ( ( ) => this . _handleHeartbeatFirstTimeout ( ) , isConnecting ? HeartbeatConstants . ConnectingBeatInterval : ( HeartbeatConstants . BeatInterval * HeartbeatConstants . FirstWaitMultiplier ) ) ;
357
356
if ( ! this . _isResponsive ) {
358
357
this . _isResponsive = true ;
359
358
this . _onPtyHostResponsive . fire ( ) ;
You can’t perform that action at this time.
0 commit comments