refactor(core): Load and validate all config at startup (no-changelog) (#5283)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-01-30 14:42:30 +01:00
committed by GitHub
parent b2f59c3f39
commit 72249e0de8
16 changed files with 80 additions and 163 deletions

View File

@@ -14,12 +14,11 @@ import type { FindManyOptions, ObjectLiteral } from 'typeorm';
import { LessThanOrEqual } from 'typeorm';
import { DateUtils } from 'typeorm/util/DateUtils';
import config from '@/config';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import * as GenericHelpers from '@/GenericHelpers';
import * as ActiveExecutions from '@/ActiveExecutions';
import type {
DatabaseType,
IExecutionFlattedDb,
IExecutionsStopData,
IWorkflowExecutionDataProcess,
@@ -63,7 +62,8 @@ export class WaitTrackerClass {
waitTill: 'ASC',
},
};
const dbType = (await GenericHelpers.getConfigValue('database.type')) as DatabaseType;
const dbType = config.getEnv('database.type');
if (dbType === 'sqlite') {
// This is needed because of issue in TypeORM <> SQLite:
// https://github.com/typeorm/typeorm/issues/2286