Skip to content

Commit dfc88e5

Browse files
committed
Introduce the new "current dequeued concurrency set"
1 parent 287d09a commit dfc88e5

File tree

8 files changed

+378
-136
lines changed

8 files changed

+378
-136
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import {
1010
import { DialogClose } from "@radix-ui/react-dialog";
1111
import {
1212
Form,
13+
useNavigate,
1314
useNavigation,
1415
useRevalidator,
1516
useSearchParams,
16-
type MetaFunction
17+
type MetaFunction,
1718
} from "@remix-run/react";
1819
import { type ActionFunctionArgs, type LoaderFunctionArgs } from "@remix-run/server-runtime";
1920
import { type RuntimeEnvironmentType } from "@trigger.dev/database";
@@ -33,8 +34,6 @@ import { Button, LinkButton } from "~/components/primitives/Buttons";
3334
import { Callout } from "~/components/primitives/Callout";
3435
import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "~/components/primitives/Dialog";
3536
import { FormButtons } from "~/components/primitives/FormButtons";
36-
import { Header3 } from "~/components/primitives/Headers";
37-
import { Input } from "~/components/primitives/Input";
3837
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
3938
import { PaginationControls } from "~/components/primitives/Pagination";
4039
import { Paragraph } from "~/components/primitives/Paragraph";
@@ -59,7 +58,6 @@ import { useEnvironment } from "~/hooks/useEnvironment";
5958
import { useEventSource } from "~/hooks/useEventSource";
6059
import { useOrganization } from "~/hooks/useOrganizations";
6160
import { useProject } from "~/hooks/useProject";
62-
import { useThrottle } from "~/hooks/useThrottle";
6361
import { redirectWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server";
6462
import { findProjectBySlug } from "~/models/project.server";
6563
import { findEnvironmentBySlug } from "~/models/runtimeEnvironment.server";
@@ -71,6 +69,9 @@ import { docsPath, EnvironmentParamSchema, v3BillingPath } from "~/utils/pathBui
7169
import { PauseEnvironmentService } from "~/v3/services/pauseEnvironment.server";
7270
import { PauseQueueService } from "~/v3/services/pauseQueue.server";
7371
import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route";
72+
import { Header3 } from "~/components/primitives/Headers";
73+
import { Input } from "~/components/primitives/Input";
74+
import { useThrottle } from "~/hooks/useThrottle";
7475

7576
const SearchParamsSchema = z.object({
7677
query: z.string().optional(),
@@ -423,16 +424,12 @@ export default function Page() {
423424
alignment="right"
424425
className={cn(
425426
queue.paused ? "tabular-nums opacity-50" : undefined,
427+
queue.running > 0 && "text-text-bright",
426428
isAtLimit && "text-warning"
427429
)}
428430
>
429431
{queue.running}/
430-
<span
431-
className={cn(
432-
"tabular-nums text-text-dimmed",
433-
isAtLimit && "text-warning"
434-
)}
435-
>
432+
<span className={cn("tabular-nums", isAtLimit && "text-warning")}>
436433
{limit}
437434
</span>
438435
</TableCell>

apps/webapp/app/routes/resources.taskruns.$runParam.debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
102102
run.runtimeEnvironment
103103
);
104104

105-
const queueCurrentConcurrencyKey = engine.runQueue.keys.currentConcurrencyKey(
105+
const queueCurrentConcurrencyKey = engine.runQueue.keys.queueCurrentConcurrencyKey(
106106
run.runtimeEnvironment,
107107
run.queue,
108108
run.concurrencyKey ?? undefined

internal-packages/run-engine/src/engine/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ export class RunEngine {
295295
executionSnapshotSystem: this.executionSnapshotSystem,
296296
runAttemptSystem: this.runAttemptSystem,
297297
machines: this.options.machines,
298-
waitpointSystem: this.waitpointSystem,
299298
});
300299
}
301300

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,23 @@ import { RunEngineOptions } from "../types.js";
1111
import { ExecutionSnapshotSystem, getLatestExecutionSnapshot } from "./executionSnapshotSystem.js";
1212
import { RunAttemptSystem } from "./runAttemptSystem.js";
1313
import { SystemResources } from "./systems.js";
14-
import { WaitpointSystem } from "./waitpointSystem.js";
1514

1615
export type DequeueSystemOptions = {
1716
resources: SystemResources;
1817
machines: RunEngineOptions["machines"];
1918
executionSnapshotSystem: ExecutionSnapshotSystem;
2019
runAttemptSystem: RunAttemptSystem;
21-
waitpointSystem: WaitpointSystem;
2220
};
2321

2422
export class DequeueSystem {
2523
private readonly $: SystemResources;
2624
private readonly executionSnapshotSystem: ExecutionSnapshotSystem;
2725
private readonly runAttemptSystem: RunAttemptSystem;
28-
private readonly waitpointSystem: WaitpointSystem;
2926

3027
constructor(private readonly options: DequeueSystemOptions) {
3128
this.$ = options.resources;
3229
this.executionSnapshotSystem = options.executionSnapshotSystem;
3330
this.runAttemptSystem = options.runAttemptSystem;
34-
this.waitpointSystem = options.waitpointSystem;
3531
}
3632

3733
/**

0 commit comments

Comments
 (0)