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

@@ -4,7 +4,7 @@ import config from '@/config';
import { SettingsRepository } from '@db/repositories/settings.repository';
import { UserRepository } from '@db/repositories/user.repository';
import { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
import { eventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { MessageEventBus } from '@/eventbus';
import { License } from '@/License';
import { LICENSE_FEATURES, inE2ETests } from '@/constants';
import { NoAuthRequired, Patch, Post, RestController } from '@/decorators';
@@ -91,6 +91,7 @@ export class E2EController {
private readonly cacheService: CacheService,
private readonly push: Push,
private readonly passwordUtility: PasswordUtility,
private readonly eventBus: MessageEventBus,
) {
license.isFeatureEnabled = (feature: BooleanLicenseFeature) =>
this.enabledFeatures[feature] ?? false;
@@ -136,8 +137,8 @@ export class E2EController {
}
private async resetLogStreaming() {
for (const id in eventBus.destinations) {
await eventBus.removeDestination(id, false);
for (const id in this.eventBus.destinations) {
await this.eventBus.removeDestination(id, false);
}
}