added parseIntSafe function.

This commit is contained in:
Kacper 2022-04-08 16:17:19 +02:00
parent 33090d5d4f
commit 3df18be4b2
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 = {
@ -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