Skip to content
Merged
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
7 changes: 7 additions & 0 deletions apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ function ReplayForm({
tags,
version,
machine,
prioritySeconds,
},
] = useForm({
id: "replay-task",
Expand Down Expand Up @@ -499,6 +500,12 @@ function ReplayForm({
<Hint>Delays run by a specific duration.</Hint>
<FormError id={delaySeconds.errorId}>{delaySeconds.error}</FormError>
</InputGroup>
<InputGroup>
<Label variant="small">Priority</Label>
<DurationPicker name={prioritySeconds.name} id={prioritySeconds.id} />
<Hint>Sets the priority of the run. Higher values mean higher priority.</Hint>
<FormError id={prioritySeconds.errorId}>{prioritySeconds.error}</FormError>
</InputGroup>
<InputGroup>
<Label variant="small">TTL</Label>
<DurationPicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ function StandardTaskForm({
tags,
version,
machine,
prioritySeconds,
},
] = useForm({
id: "test-task",
Expand Down Expand Up @@ -730,6 +731,12 @@ function StandardTaskForm({
<Hint>Delays run by a specific duration.</Hint>
<FormError id={delaySeconds.errorId}>{delaySeconds.error}</FormError>
</InputGroup>
<InputGroup>
<Label variant="small">Priority</Label>
<DurationPicker name={prioritySeconds.name} id={prioritySeconds.id} />
<Hint>Sets the priority of the run. Higher values mean higher priority.</Hint>
<FormError id={prioritySeconds.errorId}>{prioritySeconds.error}</FormError>
</InputGroup>
<InputGroup>
<Label variant="small">TTL</Label>
<DurationPicker
Expand Down Expand Up @@ -872,6 +879,7 @@ function ScheduledTaskForm({
tags,
version,
machine,
prioritySeconds,
},
] = useForm({
id: "test-task-scheduled",
Expand Down Expand Up @@ -1237,6 +1245,14 @@ function ScheduledTaskForm({
<Hint>Limits concurrency by creating a separate queue for each value of the key.</Hint>
<FormError id={concurrencyKey.errorId}>{concurrencyKey.error}</FormError>
</InputGroup>
<InputGroup>
<Label htmlFor={prioritySeconds.id} variant="small">
Priority
</Label>
<DurationPicker name={prioritySeconds.name} id={prioritySeconds.id} />
<Hint>Sets the priority of the run. Higher values mean higher priority.</Hint>
<FormError id={prioritySeconds.errorId}>{prioritySeconds.error}</FormError>
</InputGroup>
<InputGroup>
<Label htmlFor={ttlSeconds.id} variant="small">
TTL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export const action: ActionFunction = async ({ request, params }) => {
idempotencyKeyTTLSeconds: submission.value.idempotencyKeyTTLSeconds,
ttlSeconds: submission.value.ttlSeconds,
version: submission.value.version,
prioritySeconds: submission.value.prioritySeconds,
});

if (!newRun) {
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/app/v3/services/replayTaskRun.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class ReplayTaskRunService extends BaseService {
overrideOptions.version === "latest" ? undefined : overrideOptions.version,
bulkActionId: overrideOptions?.bulkActionId,
region,
priority: overrideOptions.prioritySeconds,
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/app/v3/services/testTask.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class TestTaskService extends BaseService {
tags: data.tags,
machine: data.machine,
lockToVersion: data.version === "latest" ? undefined : data.version,
priority: data.prioritySeconds,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is priority definitely in seconds, and not milliseconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the documents https://trigger.dev/docs/runs/priority it definitely looks like it is seconds.

},
});

Expand Down Expand Up @@ -66,6 +67,7 @@ export class TestTaskService extends BaseService {
tags: data.tags,
machine: data.machine,
lockToVersion: data.version === "latest" ? undefined : data.version,
priority: data.prioritySeconds,
},
},
{ customIcon: "scheduled" }
Expand Down
5 changes: 5 additions & 0 deletions apps/webapp/app/v3/testTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export const RunOptionsData = z.object({
message: "Each tag must be at most 128 characters long",
}),
version: z.string().optional(),
prioritySeconds: z
.number()
.min(0)
.optional()
.transform((val) => (val === 0 ? undefined : val)),
});

export type RunOptionsData = z.infer<typeof RunOptionsData>;
Expand Down