Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Aug 20, 2023
1 parent 60b5e33 commit 7898c3c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/local-ssh/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const sendExited = (exitCode: number, forceExit: boolean, exitSignal?: NodeJS.Si
// best effort to intercept process exit
const beforeExitListener = (exitCode: number) => {
process.removeListener('beforeExit', beforeExitListener);
return sendExited(exitCode, false)
return sendExited(exitCode, false);
};
process.addListener('beforeExit', beforeExitListener);
const exitProcess = async (forceExit: boolean, signal?: NodeJS.Signals) => {
Expand Down Expand Up @@ -137,7 +137,7 @@ class WebSocketSSHProxy {

private onExit() {
const exitHandler = (signal?: NodeJS.Signals) => {
exitProcess(false, signal)
exitProcess(false, signal);
};
process.on('SIGINT', exitHandler);
process.on('SIGTERM', exitHandler);
Expand Down Expand Up @@ -298,13 +298,13 @@ class WebSocketSSHProxy {
this.telemetryService.sendUserFlowStatus('stale', this.flow);
socket.terminate();
}, pingPeriod + 1000);
}
};
const stopHearbeat = () => {
if (pingTimeout != undefined) {
if (pingTimeout !== undefined) {
clearTimeout(pingTimeout);
pingTimeout = undefined;
}
}
};

socket.on('ping', heartbeat);
heartbeat();
Expand All @@ -314,12 +314,12 @@ class WebSocketSSHProxy {
socket.onclose = (e) => {
stopHearbeat();
wrappedOnClose(e);
}
};
resolve(websocketStream);
}
};
socket.onerror = (e) => {
reject(e);
}
};
});

const config = new SshSessionConfiguration();
Expand Down

0 comments on commit 7898c3c

Please sign in to comment.