mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(core): Fix stopping and retrying failed executions (#8480)
This commit is contained in:
parent
981ea3930e
commit
238b54c77b
|
@ -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[]) {
|
async findIfShared(executionId: string, sharedWorkflowIds: string[]) {
|
||||||
return await this.findSingleExecution(executionId, {
|
return await this.findSingleExecution(executionId, {
|
||||||
where: {
|
where: {
|
||||||
|
|
|
@ -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
|
// queue mode
|
||||||
|
|
||||||
|
|
|
@ -179,10 +179,10 @@ export class ExecutionService {
|
||||||
|
|
||||||
async retry(req: ExecutionRequest.Retry, sharedWorkflowIds: string[]) {
|
async retry(req: ExecutionRequest.Retry, sharedWorkflowIds: string[]) {
|
||||||
const { id: executionId } = req.params;
|
const { id: executionId } = req.params;
|
||||||
const execution = (await this.executionRepository.findIfShared(
|
const execution = await this.executionRepository.findWithUnflattenedData(
|
||||||
executionId,
|
executionId,
|
||||||
sharedWorkflowIds,
|
sharedWorkflowIds,
|
||||||
)) as unknown as IExecutionResponse;
|
);
|
||||||
|
|
||||||
if (!execution) {
|
if (!execution) {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
|
|
Loading…
Reference in a new issue