From 58e55ba6691dc73a9f475a1989dccb51144e1825 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Mon, 4 Sep 2023 13:26:02 +0300 Subject: [PATCH] fix(Postgres Node): Tunnel doesn't always close (#7087) --- .../nodes/Postgres/v2/actions/database/insert.operation.ts | 2 +- .../nodes/Postgres/v2/actions/database/update.operation.ts | 2 +- .../nodes/Postgres/v2/actions/database/upsert.operation.ts | 2 +- .../nodes/Postgres/v2/methods/resourceMapping.ts | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Postgres/v2/actions/database/insert.operation.ts b/packages/nodes-base/nodes/Postgres/v2/actions/database/insert.operation.ts index ec18b2ff55..29ae34b5c5 100644 --- a/packages/nodes-base/nodes/Postgres/v2/actions/database/insert.operation.ts +++ b/packages/nodes-base/nodes/Postgres/v2/actions/database/insert.operation.ts @@ -135,7 +135,7 @@ const properties: INodeProperties[] = [ }, displayOptions: { show: { - '@version': [2.2], + '@version': [2.2, 2.3], }, }, }, diff --git a/packages/nodes-base/nodes/Postgres/v2/actions/database/update.operation.ts b/packages/nodes-base/nodes/Postgres/v2/actions/database/update.operation.ts index 72d93ff0ea..1261e4905c 100644 --- a/packages/nodes-base/nodes/Postgres/v2/actions/database/update.operation.ts +++ b/packages/nodes-base/nodes/Postgres/v2/actions/database/update.operation.ts @@ -172,7 +172,7 @@ const properties: INodeProperties[] = [ }, displayOptions: { show: { - '@version': [2.2], + '@version': [2.2, 2.3], }, }, }, diff --git a/packages/nodes-base/nodes/Postgres/v2/actions/database/upsert.operation.ts b/packages/nodes-base/nodes/Postgres/v2/actions/database/upsert.operation.ts index dce4609bd4..b6783ff47b 100644 --- a/packages/nodes-base/nodes/Postgres/v2/actions/database/upsert.operation.ts +++ b/packages/nodes-base/nodes/Postgres/v2/actions/database/upsert.operation.ts @@ -171,7 +171,7 @@ const properties: INodeProperties[] = [ }, displayOptions: { show: { - '@version': [2.2], + '@version': [2.2, 2.3], }, }, }, diff --git a/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts b/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts index bf2b80bbc9..ce2e29c513 100644 --- a/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts +++ b/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts @@ -47,7 +47,7 @@ export async function getMappingColumns( ): Promise { const credentials = await this.getCredentials('postgres'); - const { db } = await configurePostgres(credentials); + const { db, sshClient } = await configurePostgres(credentials); const schema = this.getNodeParameter('schema', 0, { extractValue: true, @@ -88,5 +88,10 @@ export async function getMappingColumns( return { fields }; } catch (error) { throw error; + } finally { + if (sshClient) { + sshClient.end(); + } + await db.$pool.end(); } }