Skip to content
Snippets Groups Projects
Commit ec2c31aa authored by michael.minelli's avatar michael.minelli
Browse files

InitialImport => Only load env vars on first process (load for all processes)

parent 38e2a968
No related branches found
No related tags found
No related merge requests found
Pipeline #26876 passed
import path from 'node:path'; import path from 'node:path';
import cluster from 'node:cluster';
if ( process.env.NODE_ENV && process.env.NODE_ENV === 'production' ) { if ( cluster.isPrimary ) {
const myEnv = require('dotenv').config(); if ( process.env.NODE_ENV && process.env.NODE_ENV === 'production' ) {
require('dotenv-expand').expand(myEnv); const myEnv = require('dotenv').config();
} else { require('dotenv-expand').expand(myEnv);
require('dotenv').config({ path: path.join(__dirname, '../.env.keys') }); } else {
const myEnv = require('dotenv').config({ DOTENV_KEY: process.env.DOTENV_KEY_DEVELOPMENT }); require('dotenv').config({ path: path.join(__dirname, '../.env.keys') });
require('dotenv-expand').expand(myEnv); const myEnv = require('dotenv').config({ DOTENV_KEY: process.env.DOTENV_KEY_DEVELOPMENT });
require('dotenv-expand').expand(myEnv);
}
} }
require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be after the dotenv.config() calls require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be after the dotenv.config() calls
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment