refactor(core): Use DI for eventBus code - Part 1 (no-changelog) (#8434)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-01-26 12:21:15 +01:00
committed by GitHub
parent 3cc0f81c02
commit 7c49004018
19 changed files with 399 additions and 355 deletions

View File

@@ -67,7 +67,7 @@ import { setupAuthMiddlewares } from './middlewares';
import { isLdapEnabled } from './Ldap/helpers';
import { AbstractServer } from './AbstractServer';
import { PostHogClient } from './posthog';
import { eventBus } from './eventbus';
import { MessageEventBus } from '@/eventbus';
import { InternalHooks } from './InternalHooks';
import { License } from './License';
import { SamlController } from './sso/saml/routes/saml.controller.ee';
@@ -416,10 +416,8 @@ export class Server extends AbstractServer {
// ----------------------------------------
// EventBus Setup
// ----------------------------------------
if (!eventBus.isInitialized) {
await eventBus.initialize();
}
const eventBus = Container.get(MessageEventBus);
await eventBus.initialize();
if (this.endpointPresetCredentials !== '') {
// POST endpoint to set preset credentials