diff --git a/app/utils/config/headplane.ts b/app/utils/config/headplane.ts index 984a969..fd39b32 100644 --- a/app/utils/config/headplane.ts +++ b/app/utils/config/headplane.ts @@ -35,16 +35,16 @@ export interface HeadplaneContext { let context: HeadplaneContext | undefined export async function loadContext(): Promise { + if (context) { + return context + } + const envFile = process.env.LOAD_ENV_FILE === 'true' if (envFile) { log.info('CTXT', 'Loading environment variables from .env') await import('dotenv/config') } - if (context) { - return context - } - const debug = process.env.DEBUG === 'true' if (debug) { log.info('CTXT', 'Debug mode is enabled! Logs will spam a lot.')