fix(core): Fix stopping and retrying failed executions (#8480)

This commit is contained in:
Iván Ovejero 2024-01-29 16:34:58 +01:00 committed by GitHub
parent 981ea3930e
commit 238b54c77b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View file

@ -649,6 +649,16 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
});
}
async findWithUnflattenedData(executionId: string, accessibleWorkflowIds: string[]) {
return await this.findSingleExecution(executionId, {
where: {
workflowId: In(accessibleWorkflowIds),
},
includeData: true,
unflattenData: true,
});
}
async findIfShared(executionId: string, sharedWorkflowIds: string[]) {
return await this.findSingleExecution(executionId, {
where: {

View file

@ -104,7 +104,7 @@ export class ActiveExecutionService {
};
}
if (!this.isRegularMode) return await this.waitTracker.stopExecution(execution.id);
if (this.isRegularMode) return await this.waitTracker.stopExecution(execution.id);
// queue mode

View file

@ -179,10 +179,10 @@ export class ExecutionService {
async retry(req: ExecutionRequest.Retry, sharedWorkflowIds: string[]) {
const { id: executionId } = req.params;
const execution = (await this.executionRepository.findIfShared(
const execution = await this.executionRepository.findWithUnflattenedData(
executionId,
sharedWorkflowIds,
)) as unknown as IExecutionResponse;
);
if (!execution) {
this.logger.info(