fix(core): Prevent executions from becoming forever running (#7569)

Fixes CP-867
Possibly also fixes PAY-323 and PAY-412
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-01 13:51:13 +01:00
committed by GitHub
parent 0746783e02
commit 9bdb85c4ce
4 changed files with 18 additions and 25 deletions

View File

@@ -112,13 +112,11 @@ export class Worker extends BaseCommand {
async runJob(job: Job, nodeTypes: INodeTypes): Promise<JobResponse> {
const { executionId, loadStaticData } = job.data;
const fullExecutionData = await Container.get(ExecutionRepository).findSingleExecution(
executionId,
{
includeData: true,
unflattenData: true,
},
);
const executionRepository = Container.get(ExecutionRepository);
const fullExecutionData = await executionRepository.findSingleExecution(executionId, {
includeData: true,
unflattenData: true,
});
if (!fullExecutionData) {
this.logger.error(
@@ -133,6 +131,7 @@ export class Worker extends BaseCommand {
this.logger.info(
`Start job: ${job.id} (Workflow ID: ${workflowId} | Execution: ${executionId})`,
);
await executionRepository.updateStatus(executionId, 'running');
const workflowOwner = await Container.get(OwnershipService).getWorkflowOwnerCached(workflowId);