Skip to content

Commit

Permalink
fix(job): fix jobs stopping immediately after starting
Browse files Browse the repository at this point in the history
  • Loading branch information
SewerynKras committed Jul 16, 2024
1 parent 64cdf97 commit a1da9d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/experimental/job/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export class Job<Output = unknown> {
}

signal.addEventListener("abort", () => this.events.emit("canceled"), { once: true });
return workOnGolem(exeUnit);
// remember to `await` here so that the `finally` block is executed AFTER the work is done
return await workOnGolem(exeUnit);
} finally {
await rental.stopAndFinalize();
}
Expand Down

0 comments on commit a1da9d1

Please sign in to comment.