Skip to content

Commit

Permalink
Only finish once
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 20, 2024
1 parent 48ac9ea commit 6f392f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,12 @@ export function _runTaskList(
let gracefulShutdownPromise: Promise<void> | null = null;
let forcefulShutdownPromise: Promise<void> | null = null;

let finished = false;
const finWithError = (e: unknown) => {
if (finished) {
return;
}
finished = true;
const error = e != null ? coerceError(e) : null;
if (error) {
_finPromise.reject(error);
Expand Down

0 comments on commit 6f392f3

Please sign in to comment.