mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Revert "refactor(core): Use typedi to manage EventBus singletons (#5795)" (no-changelog) (#5825)
Revert "refactor(core): Use typedi to manage EventBus singletons (no-changelog) (#5795)"
This reverts commit 522c790817.
This commit is contained in:
committed by
GitHub
parent
6c35ffa82c
commit
58fda255fe
@@ -146,6 +146,7 @@ import { configureMetrics } from './metrics';
|
||||
import { setupBasicAuth } from './middlewares/basicAuth';
|
||||
import { setupExternalJWTAuth } from './middlewares/externalJWTAuth';
|
||||
import { PostHogClient } from './posthog';
|
||||
import { eventBus } from './eventbus';
|
||||
import { Container } from 'typedi';
|
||||
import { InternalHooks } from './InternalHooks';
|
||||
import {
|
||||
@@ -156,7 +157,6 @@ import { getSamlLoginLabel, isSamlLoginEnabled, isSamlLicensed } from './sso/sam
|
||||
import { SamlController } from './sso/saml/routes/saml.controller.ee';
|
||||
import { SamlService } from './sso/saml/saml.service.ee';
|
||||
import { LdapManager } from './Ldap/LdapManager.ee';
|
||||
import { MessageEventBus } from '@/eventbus';
|
||||
|
||||
const exec = promisify(callbackExec);
|
||||
|
||||
@@ -365,7 +365,7 @@ class Server extends AbstractServer {
|
||||
return this.frontendSettings;
|
||||
}
|
||||
|
||||
private async registerControllers(ignoredEndpoints: Readonly<string[]>) {
|
||||
private registerControllers(ignoredEndpoints: Readonly<string[]>) {
|
||||
const { app, externalHooks, activeWorkflowRunner, nodeTypes } = this;
|
||||
const repositories = Db.collections;
|
||||
setupAuthMiddlewares(app, ignoredEndpoints, this.restEndpoint, repositories.User);
|
||||
@@ -376,11 +376,8 @@ class Server extends AbstractServer {
|
||||
const postHog = this.postHog;
|
||||
const samlService = Container.get(SamlService);
|
||||
|
||||
const eventBus = Container.get(MessageEventBus);
|
||||
await eventBus.initialize();
|
||||
|
||||
const controllers: object[] = [
|
||||
new EventBusController(eventBus),
|
||||
new EventBusController(),
|
||||
new AuthController({ config, internalHooks, repositories, logger, postHog }),
|
||||
new OwnerController({ config, internalHooks, repositories, logger }),
|
||||
new MeController({ externalHooks, internalHooks, repositories, logger }),
|
||||
@@ -500,7 +497,7 @@ class Server extends AbstractServer {
|
||||
|
||||
await handleLdapInit();
|
||||
|
||||
await this.registerControllers(ignoredEndpoints);
|
||||
this.registerControllers(ignoredEndpoints);
|
||||
|
||||
this.app.use(`/${this.restEndpoint}/credentials`, credentialsController);
|
||||
|
||||
@@ -1226,6 +1223,14 @@ class Server extends AbstractServer {
|
||||
),
|
||||
);
|
||||
|
||||
// ----------------------------------------
|
||||
// EventBus Setup
|
||||
// ----------------------------------------
|
||||
|
||||
if (!eventBus.isInitialized) {
|
||||
await eventBus.initialize();
|
||||
}
|
||||
|
||||
// ----------------------------------------
|
||||
// Webhooks
|
||||
// ----------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user