api/env: log information about dynamic env changes
This commit is contained in:
@@ -12,12 +12,19 @@ export const canonicalEnv = Object.freeze(structuredClone(process.env));
|
||||
export const setTunnelPort = (port) => env.tunnelPort = port;
|
||||
export const isCluster = env.instanceCount > 1;
|
||||
export const updateEnv = (newEnv) => {
|
||||
const changes = [];
|
||||
|
||||
// tunnelPort is special and needs to get carried over here
|
||||
newEnv.tunnelPort = env.tunnelPort;
|
||||
|
||||
for (const key in env) {
|
||||
if (String(env[key]) !== String(newEnv[key])) {
|
||||
changes.push(key);
|
||||
}
|
||||
env[key] = newEnv[key];
|
||||
}
|
||||
|
||||
return changes;
|
||||
}
|
||||
|
||||
await validateEnvs(env);
|
||||
|
||||
Reference in New Issue
Block a user