Fix restoring after waiting for task/batch

This commit is contained in:
Eric Allam
2024-04-19 18:58:57 +01:00
parent f339b41ef3
commit 62c9a5b712
3 changed files with 18 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
---
"trigger.dev": patch
"@trigger.dev/core": patch
---
Fixes an issue that caused failed tasks when resuming after calling `triggerAndWait` or `batchTriggerAndWait` in prod/staging (this doesn't effect dev).
The version of Node.js we use for deployed workers (latest 20) would crash with an out-of-memory error when the checkpoint was restored. This crash does not happen on Node 18x or Node21x, so we've decided to upgrade the worker version to Node.js21x, to mitigate this issue.
You'll need to re-deploy to production to fix the issue.
+1 -1
View File
@@ -1,4 +1,4 @@
FROM node:20-bookworm-slim@sha256:d4cdfc305abe5ea78da7167bf78263c22596dc332f2654b662890777ea166224 AS base
FROM node:21-bookworm-slim@sha256:fb82287cf66ca32d854c05f54251fca8b572149163f154248df7e800003c90b5 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -95,7 +95,11 @@ export class ProdRuntimeManager implements RuntimeManager {
friendlyId: params.id,
});
return await promise;
const result = await promise;
clock.reset();
return result;
}
async waitForBatch(params: {
@@ -122,6 +126,8 @@ export class ProdRuntimeManager implements RuntimeManager {
const results = await promise;
clock.reset();
return {
id: params.id,
items: results,