@ -23,6 +23,8 @@ if (!LOADED && isDev() && !isTest()) {
LOADED = true
LOADED = true
}
}
let inThread = false
module . exports = {
module . exports = {
// important
// important
PORT : process . env . PORT ,
PORT : process . env . PORT ,
@ -62,6 +64,7 @@ module.exports = {
USERID_API_KEY : process . env . USERID_API_KEY ,
USERID_API_KEY : process . env . USERID_API_KEY ,
DEPLOYMENT_CREDENTIALS_URL : process . env . DEPLOYMENT_CREDENTIALS_URL ,
DEPLOYMENT_CREDENTIALS_URL : process . env . DEPLOYMENT_CREDENTIALS_URL ,
ALLOW_DEV_AUTOMATIONS : process . env . ALLOW_DEV_AUTOMATIONS ,
ALLOW_DEV_AUTOMATIONS : process . env . ALLOW_DEV_AUTOMATIONS ,
DISABLE_THREADING : process . env . DISABLE_THREADING ,
_ set ( key , value ) {
_ set ( key , value ) {
process . env [ key ] = value
process . env [ key ] = value
module . exports [ key ] = value
module . exports [ key ] = value
@ -72,6 +75,18 @@ module.exports = {
isProd : ( ) => {
isProd : ( ) => {
return ! isDev ( )
return ! isDev ( )
} ,
} ,
// used to check if already in a thread, don't thread further
setInThread : ( ) => {
inThread = true
} ,
isInThread : ( ) => {
return inThread
} ,
}
// threading can cause memory issues with node-ts in development
if ( isDev ( ) && module . exports . DISABLE_THREADING == null ) {
module . exports . _ set ( "DISABLE_THREADING" , "1" )
}
}
// clean up any environment variable edge cases
// clean up any environment variable edge cases