From 86f59fb71de43245720888126cc7de5b6ee54610 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 1 Aug 2024 11:20:23 +0100 Subject: [PATCH] Fixes an issue with MS-SQL timeouts, it doesn't respect query timeout value as the client has its own built in timeout by default of 15000ms. --- packages/server/scripts/integrations/mssql/data/Dockerfile | 2 +- packages/server/src/integrations/microsoftSqlServer.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/scripts/integrations/mssql/data/Dockerfile b/packages/server/scripts/integrations/mssql/data/Dockerfile index c26af556a9..2bdca4490c 100644 --- a/packages/server/scripts/integrations/mssql/data/Dockerfile +++ b/packages/server/scripts/integrations/mssql/data/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/mssql/server:2022-latest +FROM mcr.microsoft.com/mssql/server@sha256:c4369c38385eba011c10906dc8892425831275bb035d5ce69656da8e29de50d8 ENV ACCEPT_EULA=Y ENV SA_PASSWORD=Passw0rd diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index af535891cf..88c75891e6 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -29,6 +29,7 @@ import { getReadableErrorMessage } from "./base/errorMapping" import sqlServer from "mssql" import { sql } from "@budibase/backend-core" import { ConfidentialClientApplication } from "@azure/msal-node" +import env from "../environment" import { utils } from "@budibase/shared-core" @@ -246,6 +247,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { options: { encrypt, enableArithAbort: true, + requestTimeout: env.QUERY_THREAD_TIMEOUT, }, } if (encrypt) {