Use orderableName on the TaskQueue and add the releaseConcurrencyOnWaitpoint to the SDK and the dashboard
This commit is contained in:
@@ -161,7 +161,12 @@ export const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellP
|
||||
{hiddenLabel ? (
|
||||
<span className="sr-only">{children}</span>
|
||||
) : tooltip ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div
|
||||
className={cn("flex items-center gap-1", {
|
||||
"justify-center": alignment === "center",
|
||||
"justify-end": alignment === "right",
|
||||
})}
|
||||
>
|
||||
{children}
|
||||
<InfoIconTooltip content={tooltip} contentClassName="normal-case tracking-normal" />
|
||||
</div>
|
||||
|
||||
@@ -61,12 +61,14 @@ export class QueueListPresenter extends BasePresenter {
|
||||
select: {
|
||||
friendlyId: true,
|
||||
name: true,
|
||||
orderableName: true,
|
||||
concurrencyLimit: true,
|
||||
type: true,
|
||||
paused: true,
|
||||
releaseConcurrencyOnWaitpoint: true,
|
||||
},
|
||||
orderBy: {
|
||||
name: "asc",
|
||||
orderableName: "asc",
|
||||
},
|
||||
skip: (page - 1) * this.perPage,
|
||||
take: this.perPage,
|
||||
@@ -93,6 +95,7 @@ export class QueueListPresenter extends BasePresenter {
|
||||
queued: results[0][queue.name] ?? 0,
|
||||
concurrencyLimit: queue.concurrencyLimit ?? null,
|
||||
paused: queue.paused,
|
||||
releaseConcurrencyOnWaitpoint: queue.releaseConcurrencyOnWaitpoint,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ export class QueueRetrievePresenter extends BasePresenter {
|
||||
queued: results[0]?.[queue.name] ?? 0,
|
||||
concurrencyLimit: queue.concurrencyLimit ?? null,
|
||||
paused: queue.paused,
|
||||
releaseConcurrencyOnWaitpoint: queue.releaseConcurrencyOnWaitpoint,
|
||||
}),
|
||||
};
|
||||
}
|
||||
@@ -105,6 +106,7 @@ export function toQueueItem(data: {
|
||||
queued: number;
|
||||
concurrencyLimit: number | null;
|
||||
paused: boolean;
|
||||
releaseConcurrencyOnWaitpoint: boolean;
|
||||
}): QueueItem {
|
||||
return {
|
||||
id: data.friendlyId,
|
||||
@@ -115,5 +117,6 @@ export function toQueueItem(data: {
|
||||
queued: data.queued,
|
||||
concurrencyLimit: data.concurrencyLimit,
|
||||
paused: data.paused,
|
||||
releaseConcurrencyOnWaitpoint: data.releaseConcurrencyOnWaitpoint,
|
||||
};
|
||||
}
|
||||
|
||||
+32
@@ -295,6 +295,32 @@ export default function Page() {
|
||||
<TableHeaderCell>Name</TableHeaderCell>
|
||||
<TableHeaderCell alignment="right">Queued</TableHeaderCell>
|
||||
<TableHeaderCell alignment="right">Running</TableHeaderCell>
|
||||
<TableHeaderCell
|
||||
alignment="right"
|
||||
tooltip={
|
||||
<div className="max-w-xs p-1 text-left">
|
||||
<Paragraph
|
||||
variant="small"
|
||||
className="!text-wrap text-text-dimmed"
|
||||
spacing
|
||||
>
|
||||
When a task executing on this queue is paused and waiting for a
|
||||
waitpoint to complete, the queue will release the concurrency being used
|
||||
by the run so other runs can be started.
|
||||
</Paragraph>
|
||||
<LinkButton
|
||||
to={docsPath("v3/queues#release-concurrency-on-waitpoint")}
|
||||
variant="docs/small"
|
||||
LeadingIcon={BookOpenIcon}
|
||||
className="mt-3"
|
||||
>
|
||||
Read docs
|
||||
</LinkButton>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
Release on waitpoint
|
||||
</TableHeaderCell>
|
||||
<TableHeaderCell alignment="right">Concurrency limit</TableHeaderCell>
|
||||
<TableHeaderCell className="w-[1%] pl-24">
|
||||
<span className="sr-only">Pause/resume</span>
|
||||
@@ -354,6 +380,12 @@ export default function Page() {
|
||||
>
|
||||
{queue.running}
|
||||
</TableCell>
|
||||
<TableCell
|
||||
alignment="right"
|
||||
className={queue.paused ? "opacity-50" : undefined}
|
||||
>
|
||||
{queue.releaseConcurrencyOnWaitpoint ? "Yes" : "No"}
|
||||
</TableCell>
|
||||
<TableCell
|
||||
alignment="right"
|
||||
className={queue.paused ? "opacity-50" : undefined}
|
||||
|
||||
@@ -394,6 +394,7 @@ async function createWorkerQueue(
|
||||
data: {
|
||||
workers: { connect: { id: worker.id } },
|
||||
version: "V2",
|
||||
orderableName,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ export const QueueItem = z.object({
|
||||
concurrencyLimit: z.number().nullable(),
|
||||
/** Whether the queue is paused. If it's paused, no new runs will be started. */
|
||||
paused: z.boolean(),
|
||||
/** Whether the queue releases concurrency on waitpoints. */
|
||||
releaseConcurrencyOnWaitpoint: z.boolean(),
|
||||
});
|
||||
|
||||
export type QueueItem = z.infer<typeof QueueItem>;
|
||||
|
||||
Reference in New Issue
Block a user