From a1da9d1f001373484c3f6cb4788c0f7a2ef33c21 Mon Sep 17 00:00:00 2001 From: Seweryn Kras Date: Tue, 16 Jul 2024 17:28:13 +0200 Subject: [PATCH] fix(job): fix jobs stopping immediately after starting --- src/experimental/job/job.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/experimental/job/job.ts b/src/experimental/job/job.ts index 395705e24..dad128af5 100644 --- a/src/experimental/job/job.ts +++ b/src/experimental/job/job.ts @@ -145,7 +145,8 @@ export class Job { } 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(); }