Skip to content

Commit

Permalink
fix(core): Clear active execution on cancellation in scaling mode (n8…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Jul 9, 2024
1 parent 761229e commit 7e972c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ describe('ExecutionService', () => {
* Assert
*/
expect(waitTracker.stopExecution).not.toHaveBeenCalled();
expect(activeExecutions.stopExecution).toHaveBeenCalled();
expect(queue.findRunningJobBy).toBeCalledWith({ executionId: execution.id });
expect(queue.stopJob).toHaveBeenCalled();
expect(executionRepository.stopDuringRun).toHaveBeenCalled();
Expand All @@ -260,6 +261,7 @@ describe('ExecutionService', () => {
* Assert
*/
expect(waitTracker.stopExecution).toHaveBeenCalledWith(execution.id);
expect(activeExecutions.stopExecution).toHaveBeenCalled();
expect(queue.findRunningJobBy).toBeCalledWith({ executionId: execution.id });
expect(queue.stopJob).toHaveBeenCalled();
expect(executionRepository.stopDuringRun).toHaveBeenCalled();
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/executions/execution.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ export class ExecutionService {
return await this.stopInRegularMode(execution);
}

if (this.activeExecutions.has(execution.id)) {
await this.activeExecutions.stopExecution(execution.id);
}

if (this.waitTracker.has(execution.id)) {
await this.waitTracker.stopExecution(execution.id);
}
Expand Down

0 comments on commit 7e972c7

Please sign in to comment.