refactor(core): Revamp crash recovery mechanism for main mode (#9613)

This commit is contained in:
Iván Ovejero
2024-06-07 16:19:59 +02:00
committed by GitHub
parent 291d46af15
commit b8338e3610
10 changed files with 648 additions and 223 deletions

View File

@@ -32,7 +32,7 @@ import {
import { METRICS_EVENT_NAME } from '../MessageEventBusDestination/Helpers.ee';
import type { AbstractEventMessageOptions } from '../EventMessageClasses/AbstractEventMessageOptions';
import { getEventMessageObjectByType } from '../EventMessageClasses/Helpers';
import { ExecutionDataRecoveryService } from '../executionDataRecovery.service';
import { ExecutionRecoveryService } from '../../executions/execution-recovery.service';
import {
EventMessageAiNode,
type EventMessageAiNodeOptions,
@@ -68,7 +68,7 @@ export class MessageEventBus extends EventEmitter {
private readonly eventDestinationsRepository: EventDestinationsRepository,
private readonly workflowRepository: WorkflowRepository,
private readonly orchestrationService: OrchestrationService,
private readonly recoveryService: ExecutionDataRecoveryService,
private readonly recoveryService: ExecutionRecoveryService,
) {
super();
}
@@ -185,10 +185,9 @@ export class MessageEventBus extends EventEmitter {
);
await this.executionRepository.markAsCrashed([executionId]);
} else {
await this.recoveryService.recoverExecutionData(
await this.recoveryService.recover(
executionId,
unsentAndUnfinished.unfinishedExecutions[executionId],
true,
);
}
}