From 85326f8d50088f12b1176b4ecebe40b775eb589a Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 19 Oct 2023 19:52:48 +0000 Subject: [PATCH 1/2] fix: drop test connection after getting result --- packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2.ts b/packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2.ts index 0368d6c496..3125c0e1ac 100644 --- a/packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2.ts +++ b/packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2.ts @@ -36,7 +36,12 @@ export default class SqlMgrv2 { public static async testConnection(args = {}) { const client = await SqlClientFactory.create(args); - return client.testConnection(); + const result = await client.testConnection(); + + // close connection + await client.knex.destroy(); + + return result; } /** From a3faed647dd3158025ff6357b64423b069375f5f Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 19 Oct 2023 19:52:49 +0000 Subject: [PATCH 2/2] fix: hardcode test connection pool size --- packages/nocodb/src/controllers/utils.controller.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nocodb/src/controllers/utils.controller.ts b/packages/nocodb/src/controllers/utils.controller.ts index 0aee637ff4..a3e24a5857 100644 --- a/packages/nocodb/src/controllers/utils.controller.ts +++ b/packages/nocodb/src/controllers/utils.controller.ts @@ -45,6 +45,11 @@ export class UtilsController { }) @HttpCode(200) async testConnection(@Body() body: any) { + body.pool = { + min: 0, + max: 1, + }; + return await this.utilsService.testConnection({ body }); }