Skip to content

Commit 54a4e24

Browse files
committed
elderberry
1 parent 3cd7dd8 commit 54a4e24

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export class RunAttemptSystem {
181181
lockedById: true,
182182
lockedQueueId: true,
183183
queue: true,
184+
concurrencyKey: true,
184185
attemptNumber: true,
185186
status: true,
186187
ttl: true,
@@ -248,6 +249,7 @@ export class RunAttemptSystem {
248249
]);
249250

250251
return {
252+
concurrencyKey: run.concurrencyKey ?? undefined,
251253
run: {
252254
id: run.friendlyId,
253255
tags: run.runTags,
@@ -396,6 +398,7 @@ export class RunAttemptSystem {
396398
lockedById: true,
397399
lockedQueueId: true,
398400
queue: true,
401+
concurrencyKey: true,
399402
attemptNumber: true,
400403
status: true,
401404
ttl: true,
@@ -533,6 +536,7 @@ export class RunAttemptSystem {
533536
]);
534537

535538
const execution: BackwardsCompatibleTaskRunExecution = {
539+
concurrencyKey: updatedRun.concurrencyKey ?? undefined,
536540
attempt: {
537541
number: nextAttemptNumber,
538542
startedAt: latestSnapshot.updatedAt,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ export const TaskRunExecution = z.object({
334334
traceContext: z.record(z.unknown()).optional(),
335335
})
336336
),
337+
// The concurrencyKey creates a copy of the queue per unique value
338+
concurrencyKey: z.string().optional(),
337339
...StaticTaskRunExecutionShape,
338340
});
339341

@@ -406,6 +408,8 @@ export const TaskRunContext = z.object({
406408
durationMs: true,
407409
costInCents: true,
408410
}),
411+
// The concurrencyKey used for this run, if any
412+
concurrencyKey: z.string().optional(),
409413
...StaticTaskRunExecutionShape,
410414
});
411415

0 commit comments

Comments
 (0)