fix: close the SSH channel when a Dokku command is finished

This commit is contained in:
James Murdza 2024-12-31 18:22:25 -08:00 committed by Akhileshrangani4
parent 9666401625
commit ed367ed27c

View File

@ -89,10 +89,13 @@ export class SSHSocketClient {
)
})
.on("data", (data: Buffer) => {
// Netcat remains open until it is closed, so we close the connection once we receive data.
resolve(data.toString())
stream.close()
})
.stderr.on("data", (data: Buffer) => {
reject(new Error(data.toString()))
stream.close()
})
}
)