1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-08-16 16:40:30 +03:00

fix(core): Clear active execution on cancellation in scaling mode (#9979)

This commit is contained in:
Iván Ovejero 2024-07-09 17:09:39 +02:00 committed by GitHub
parent 761229e4d2
commit 7e972c78af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -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();
@ -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();

View File

@ -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);
}