fix(ssh): prevent ssh relay startup on exit

This commit is contained in:
Alexey Kasyanchuk 2018-08-08 04:16:13 +03:00
parent afa5847e82
commit 5cf5bea884

View File

@ -139,6 +139,9 @@ class p2p {
checkPortAndRedirect(address, port) {
isPortReachable(port, {host: address}).then((isAvailable) => {
if(this.closing)
return // responce can be very late, and ssh can start after closing of program, this will break on linux
this.p2pStatus = isAvailable ? 2 : 0
this.send('p2pStatus', this.p2pStatus)
@ -183,6 +186,7 @@ class p2p {
close()
{
this.closing = true
if(this.ssh)
{
logT('ssh', 'closing ssh...')