refactor(core): Avoid passing around static state like default timezone (no-changelog) (#7221)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-27 14:17:52 +02:00
committed by GitHub
parent 62c096710f
commit 35bb42c1b9
31 changed files with 76 additions and 224 deletions

View File

@@ -3,6 +3,7 @@ import dotenv from 'dotenv';
import { tmpdir } from 'os';
import { mkdirSync, mkdtempSync, readFileSync } from 'fs';
import { join } from 'path';
import { setGlobalState } from 'n8n-workflow';
import { schema } from './schema';
import { inTest, inE2ETests } from '@/constants';
@@ -73,6 +74,10 @@ config.validate({
allowed: 'strict',
});
setGlobalState({
defaultTimezone: config.getEnv('generic.timezone'),
});
// eslint-disable-next-line import/no-default-export
export default config;
export type Config = typeof config;