fix(core): Initialize License and LDAP in the correct order (#5673)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-03-10 19:05:51 +01:00
committed by GitHub
parent 5c4343b828
commit 90afa5e55f
3 changed files with 29 additions and 26 deletions

View File

@@ -34,6 +34,8 @@ export abstract class BaseCommand extends Command {
protected userSettings: IUserSettings;
protected instanceId: string;
async init(): Promise<void> {
await initErrorHandling();
@@ -49,9 +51,9 @@ export abstract class BaseCommand extends Command {
const credentialTypes = Container.get(CredentialTypes);
CredentialsOverwrites(credentialTypes);
const instanceId = this.userSettings.instanceId ?? '';
await Container.get(PostHogClient).init(instanceId);
await Container.get(InternalHooks).init(instanceId);
this.instanceId = this.userSettings.instanceId ?? '';
await Container.get(PostHogClient).init(this.instanceId);
await Container.get(InternalHooks).init(this.instanceId);
await Db.init().catch(async (error: Error) =>
this.exitWithCrash('There was an error initializing DB', error),