1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: ssh tunnel keep-alive not working properly

This commit is contained in:
2023-10-28 19:09:19 +02:00
parent 3c2e2be40f
commit debc1da289
3 changed files with 18 additions and 6 deletions

View File

@ -180,7 +180,10 @@ export class PostgreSQLClient extends BaseClient {
dbConfig.port = tunnel.localPort;
}
catch (err) {
if (this._ssh) this._ssh.close();
if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
throw err;
}
}
@ -236,7 +239,10 @@ export class PostgreSQLClient extends BaseClient {
this._connection.end();
clearInterval(this._keepaliveTimer);
this._keepaliveTimer = undefined;
if (this._ssh) this._ssh.close();
if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
}
private async keepAlive () {