refactor(core): Simplify OrchestrationService (no-changelog) (#8364)

This commit is contained in:
Iván Ovejero
2024-01-22 11:16:29 +01:00
committed by GitHub
parent 2ccb754e52
commit f35d4fcbd8
28 changed files with 323 additions and 315 deletions

View File

@@ -25,7 +25,7 @@ import * as NodeExecuteFunctions from 'n8n-core';
import { removeTrailingSlash } from './utils';
import type { TestWebhookRegistration } from '@/services/test-webhook-registrations.service';
import { TestWebhookRegistrationsService } from '@/services/test-webhook-registrations.service';
import { MultiMainSetup } from './services/orchestration/main/MultiMainSetup.ee';
import { OrchestrationService } from '@/services/orchestration.service';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
@Service()
@@ -34,7 +34,7 @@ export class TestWebhooks implements IWebhookManager {
private readonly push: Push,
private readonly nodeTypes: NodeTypes,
private readonly registrations: TestWebhookRegistrationsService,
private readonly multiMainSetup: MultiMainSetup,
private readonly orchestrationService: OrchestrationService,
) {}
private timeouts: { [webhookKey: string]: NodeJS.Timeout } = {};
@@ -144,12 +144,12 @@ export class TestWebhooks implements IWebhookManager {
* the handler process commands the creator process to clear its test webhooks.
*/
if (
this.multiMainSetup.isEnabled &&
this.orchestrationService.isMultiMainSetupEnabled &&
sessionId &&
!this.push.getBackend().hasSessionId(sessionId)
) {
const payload = { webhookKey: key, workflowEntity, sessionId };
void this.multiMainSetup.publish('clear-test-webhooks', payload);
void this.orchestrationService.publish('clear-test-webhooks', payload);
return;
}