Skip to content

Commit 22bc5eb

Browse files
committed
Added region to the ctx
1 parent 7c5209b commit 22bc5eb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export class RunAttemptSystem {
210210
parentTaskRunId: true,
211211
rootTaskRunId: true,
212212
batchId: true,
213+
workerQueue: true,
213214
},
214215
});
215216

@@ -261,6 +262,7 @@ export class RunAttemptSystem {
261262
priority: run.priorityMs === 0 ? undefined : run.priorityMs / 1_000,
262263
parentTaskRunId: run.parentTaskRunId ? RunId.toFriendlyId(run.parentTaskRunId) : undefined,
263264
rootTaskRunId: run.rootTaskRunId ? RunId.toFriendlyId(run.rootTaskRunId) : undefined,
265+
region: run.runtimeEnvironment.type !== "DEVELOPMENT" ? run.workerQueue : undefined,
264266
},
265267
attempt: {
266268
number: run.attemptNumber ?? 1,
@@ -428,6 +430,7 @@ export class RunAttemptSystem {
428430
},
429431
parentTaskRunId: true,
430432
rootTaskRunId: true,
433+
workerQueue: true,
431434
},
432435
});
433436

@@ -574,6 +577,10 @@ export class RunAttemptSystem {
574577
rootTaskRunId: updatedRun.rootTaskRunId
575578
? RunId.toFriendlyId(updatedRun.rootTaskRunId)
576579
: undefined,
580+
region:
581+
updatedRun.runtimeEnvironment.type !== "DEVELOPMENT"
582+
? updatedRun.workerQueue
583+
: undefined,
577584
},
578585
task,
579586
queue,

packages/core/src/v3/schemas/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ export const TaskRun = z.object({
229229
// These are only used during execution, not in run.ctx
230230
durationMs: z.number().optional(),
231231
costInCents: z.number().optional(),
232+
233+
region: z.string().optional(),
232234
});
233235

234236
export type TaskRun = z.infer<typeof TaskRun>;

0 commit comments

Comments
 (0)