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

@@ -22,7 +22,7 @@ import { InternalHooks } from '@/InternalHooks';
import { OwnershipService } from '@/services/ownership.service';
import { WorkflowHistoryService } from './workflowHistory/workflowHistory.service.ee';
import { Logger } from '@/Logger';
import { MultiMainSetup } from '@/services/orchestration/main/MultiMainSetup.ee';
import { OrchestrationService } from '@/services/orchestration.service';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
@@ -38,7 +38,7 @@ export class WorkflowService {
private readonly ownershipService: OwnershipService,
private readonly tagService: TagService,
private readonly workflowHistoryService: WorkflowHistoryService,
private readonly multiMainSetup: MultiMainSetup,
private readonly orchestrationService: OrchestrationService,
private readonly externalHooks: ExternalHooks,
private readonly activeWorkflowRunner: ActiveWorkflowRunner,
) {}
@@ -227,12 +227,12 @@ export class WorkflowService {
}
}
await this.multiMainSetup.init();
await this.orchestrationService.init();
const newState = updatedWorkflow.active;
if (this.multiMainSetup.isEnabled && oldState !== newState) {
await this.multiMainSetup.publish('workflowActiveStateChanged', {
if (this.orchestrationService.isMultiMainSetupEnabled && oldState !== newState) {
await this.orchestrationService.publish('workflowActiveStateChanged', {
workflowId,
oldState,
newState,