Skip to content

Commit 6f392f3

Browse files
committed
Only finish once
1 parent 48ac9ea commit 6f392f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,12 @@ export function _runTaskList(
705705
let gracefulShutdownPromise: Promise<void> | null = null;
706706
let forcefulShutdownPromise: Promise<void> | null = null;
707707

708+
let finished = false;
708709
const finWithError = (e: unknown) => {
710+
if (finished) {
711+
return;
712+
}
713+
finished = true;
709714
const error = e != null ? coerceError(e) : null;
710715
if (error) {
711716
_finPromise.reject(error);

0 commit comments

Comments
 (0)