Skip to content

Commit 46952cb

Browse files
lildeadprinceiiroj
authored andcommittedApr 15, 2022
fix: clear execution interruption interval on first catch
1 parent d327873 commit 46952cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎lib/resolveTaskFn.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ const handleOutput = (command, result, ctx, isError = false) => {
5656
* checks the context.
5757
*/
5858
const interruptExecutionOnError = (ctx, execaChildProcess) => {
59+
let loopIntervalId
60+
5961
async function loop() {
6062
if (ctx.errors.size > 0) {
63+
clearInterval(loopIntervalId)
64+
6165
const ids = await pidTree(execaChildProcess.pid)
6266
ids.forEach(process.kill)
6367

@@ -67,7 +71,7 @@ const interruptExecutionOnError = (ctx, execaChildProcess) => {
6771
}
6872
}
6973

70-
const loopIntervalId = setInterval(loop, ERROR_CHECK_INTERVAL)
74+
loopIntervalId = setInterval(loop, ERROR_CHECK_INTERVAL)
7175

7276
return () => {
7377
clearInterval(loopIntervalId)

0 commit comments

Comments
 (0)
Please sign in to comment.