From a00c9e0efb4c9be60c62650f646200d193b7df64 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Apr 2020 08:43:16 +0200 Subject: [PATCH] :bug: Fix issue that connections did not get closed --- packages/nodes-base/nodes/MySql/MySql.node.ts | 3 +++ packages/nodes-base/nodes/Postgres/Postgres.node.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/nodes-base/nodes/MySql/MySql.node.ts b/packages/nodes-base/nodes/MySql/MySql.node.ts index 04052789d0..0aa6ab372c 100644 --- a/packages/nodes-base/nodes/MySql/MySql.node.ts +++ b/packages/nodes-base/nodes/MySql/MySql.node.ts @@ -245,9 +245,12 @@ export class MySql implements INodeType { returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); } else { + await connection.end(); throw new Error(`The operation "${operation}" is not supported!`); } + await connection.end(); + return this.prepareOutputData(returnItems); } } diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index f9db1a01e1..2fa010576b 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -325,6 +325,7 @@ export class Postgres implements INodeType { returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); } else { + await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); }