From a41cdff55f6c3c07902a8827714cc5095ae5a0ef Mon Sep 17 00:00:00 2001 From: James Murdza Date: Tue, 31 Dec 2024 18:22:25 -0800 Subject: [PATCH] fix: close the SSH channel when a Dokku command is finished --- backend/server/src/SSHSocketClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/server/src/SSHSocketClient.ts b/backend/server/src/SSHSocketClient.ts index db8316d..3263203 100644 --- a/backend/server/src/SSHSocketClient.ts +++ b/backend/server/src/SSHSocketClient.ts @@ -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() }) } )