From 33090d5d4f5c0ec3a35666d6d33a221d3fd1d999 Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 13:23:44 +0200 Subject: [PATCH 1/3] QUERY_THREAD_TIMEOUT is string instead of int fix --- packages/server/src/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index bdbbbde79f..95407d87cb 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -71,7 +71,7 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: process.env.QUERY_THREAD_TIMEOUT, + QUERY_THREAD_TIMEOUT: parseInt(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value From 3df18be4b2875fdcb2b3da8813b1a13bb90c9c2d Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 16:17:19 +0200 Subject: [PATCH 2/3] added parseIntSafe function. --- packages/server/src/environment.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 95407d87cb..d967df0398 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -24,6 +24,12 @@ if (!LOADED && isDev() && !isTest()) { LOADED = true } +function parseIntSafe(number) { + if (number) { + return parseInt(number) + } +} + let inThread = false module.exports = { @@ -71,7 +77,7 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: parseInt(process.env.QUERY_THREAD_TIMEOUT), + QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value From b0019c80c76cbab861dffafdbc336b1652ffaeca Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 16:20:55 +0200 Subject: [PATCH 3/3] Move out QUERY_THREAD_TIMEOUT from `to remove` section --- packages/server/src/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index d967df0398..594a2aad28 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -68,6 +68,7 @@ module.exports = { SENDGRID_API_KEY: process.env.SENDGRID_API_KEY, DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT, POSTHOG_TOKEN: process.env.POSTHOG_TOKEN, + QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), // old - to remove CLIENT_ID: process.env.CLIENT_ID, BUDIBASE_DIR: process.env.BUDIBASE_DIR, @@ -77,7 +78,6 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value