Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export class RunAttemptSystem {
lockedById: true,
lockedQueueId: true,
queue: true,
concurrencyKey: true,
attemptNumber: true,
status: true,
ttl: true,
Expand Down Expand Up @@ -248,6 +249,7 @@ export class RunAttemptSystem {
]);

return {
concurrencyKey: run.concurrencyKey ?? undefined,
run: {
id: run.friendlyId,
tags: run.runTags,
Expand Down Expand Up @@ -396,6 +398,7 @@ export class RunAttemptSystem {
lockedById: true,
lockedQueueId: true,
queue: true,
concurrencyKey: true,
attemptNumber: true,
status: true,
ttl: true,
Expand Down Expand Up @@ -533,6 +536,7 @@ export class RunAttemptSystem {
]);

const execution: BackwardsCompatibleTaskRunExecution = {
concurrencyKey: updatedRun.concurrencyKey ?? undefined,
attempt: {
number: nextAttemptNumber,
startedAt: latestSnapshot.updatedAt,
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/v3/schemas/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ export const TaskRunExecution = z.object({
traceContext: z.record(z.unknown()).optional(),
})
),
// The concurrencyKey creates a copy of the queue per unique value
concurrencyKey: z.string().optional(),
...StaticTaskRunExecutionShape,
});

Expand Down Expand Up @@ -406,6 +408,8 @@ export const TaskRunContext = z.object({
durationMs: true,
costInCents: true,
}),
// The concurrencyKey used for this run, if any
concurrencyKey: z.string().optional(),
...StaticTaskRunExecutionShape,
});

Expand Down
Loading