Skip to content

Commit

Permalink
allow cancelling execution with wait nodes (with timeout less than 65…
Browse files Browse the repository at this point in the history
… seconds)
  • Loading branch information
netroy committed Nov 10, 2023
1 parent 2124d1f commit d2b66aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/nodes-base/nodes/Wait/Wait.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,8 @@ export class Wait extends Webhook {
// If wait time is shorter than 65 seconds leave execution active because
// we just check the database every 60 seconds.
return new Promise((resolve, _reject) => {
setTimeout(() => {
resolve([context.getInputData()]);
}, waitValue);
const timer = setTimeout(() => resolve([context.getInputData()]), waitValue);
context.onExecutionCancellation(async () => clearTimeout(timer), reject);
});
}

Expand Down

0 comments on commit d2b66aa

Please sign in to comment.