Merge pull request #5316 from Upgreydd/Fix_for_parsing_environment_variable_as_an_integer

QUERY_THREAD_TIMEOUT is string instead of int
This commit is contained in:
Martin McKeaveney 2022-04-12 11:56:36 +01:00 committed by GitHub
commit dc0eda29f3
1 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,12 @@ if (!LOADED && isDev() && !isTest()) {
LOADED = true
}
function parseIntSafe(number) {
if (number) {
return parseInt(number)
}
}
let inThread = false
module.exports = {
@ -62,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,
@ -71,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: process.env.QUERY_THREAD_TIMEOUT,
SQL_MAX_ROWS: process.env.SQL_MAX_ROWS,
_set(key, value) {
process.env[key] = value