Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(server): add TaskIdentifier registry to replace expensive distinct query#3368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
3d917e444232bb51f6a2e2b365a19e84290File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| area: webapp | ||
| type: improvement | ||
| --- | ||
| Replace the expensive DISTINCT query for task filter dropdowns with a dedicated TaskIdentifier registry table backed by Redis. Environments migrate automatically on their next deploy, with a transparent fallback to the legacy query for unmigrated environments. Also fixes duplicate dropdown entries when a task changes trigger source, and adds active/archived grouping for removed tasks. Moves BackgroundWorkerTask reads in the trigger hot path to the read replica. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,11 +2,10 @@ import { openai } from "@ai-sdk/openai"; | ||
| import { type ActionFunctionArgs, json } from "@remix-run/server-runtime"; | ||
| import { tryCatch } from "@trigger.dev/core"; | ||
| import { z } from "zod"; | ||
| import { $replica } from "~/db.server"; | ||
| import { env } from "~/env.server"; | ||
| import { findProjectBySlug } from "~/models/project.server"; | ||
| import { findEnvironmentBySlug } from "~/models/runtimeEnvironment.server"; | ||
| import { getAllTaskIdentifiers } from "~/models/task.server"; | ||
| import { getTaskIdentifiers } from "~/models/task.server"; | ||
| import { QueueListPresenter } from "~/presenters/v3/QueueListPresenter.server"; | ||
| import { RunTagListPresenter } from "~/presenters/v3/RunTagListPresenter.server"; | ||
| import { VersionListPresenter } from "~/presenters/v3/VersionListPresenter.server"; | ||
| @@ -126,7 +125,7 @@ export async function action({ request, params }: ActionFunctionArgs) { | ||
| const queryTasks: QueryTasks = { | ||
| query: async () => { | ||
| const tasks = await getAllTaskIdentifiers($replica, environment.id); | ||
| const tasks = await getTaskIdentifiers(environment.id); | ||
| return { | ||
| tasks, | ||
| }; | ||
ericallam marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.