Skip to content

Commit a3d837f

Browse files
committed
fix(webapp): unbreak local typecheck + unit tests
- Restore local import of `stripBackgroundWorkerMetadataForStorage` in `createBackgroundWorker.server.ts`; the prior diff turned it into a bare re-export and the existing in-file usage broke typecheck. - Drop the `defaultPrisma` fallback on `findOrCreateBackgroundWorker`; importing `~/db.server` in test runs triggered the singleton's lazy Prisma client to attempt a localhost:5432 connection and surface as an unhandled rejection on shutdown.
1 parent c633618 commit a3d837f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/webapp/app/v3/services/createBackgroundWorker.server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import { tryCatch } from "@trigger.dev/core/v3";
3434
import { engine } from "../runEngine.server";
3535
import { scheduleEngine } from "../scheduleEngine.server";
3636

37-
export { stripBackgroundWorkerMetadataForStorage } from "./stripBackgroundWorkerMetadataForStorage.server";
37+
import { stripBackgroundWorkerMetadataForStorage } from "./stripBackgroundWorkerMetadataForStorage.server";
38+
export { stripBackgroundWorkerMetadataForStorage };
3839

3940
export class CreateBackgroundWorkerService extends BaseService {
4041
private readonly _taskMetaCache: TaskMetadataCache;

apps/webapp/app/v3/services/createDeploymentBackgroundWorkerV4/findOrCreateBackgroundWorker.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {
55
PrismaClientOrTransaction,
66
WorkerDeployment,
77
} from "@trigger.dev/database";
8-
import { prisma as defaultPrisma } from "~/db.server";
98
import type { AuthenticatedEnvironment } from "~/services/apiAuth.server";
109
import { ServiceValidationError } from "../common.server";
1110
import { stripBackgroundWorkerMetadataForStorage } from "../stripBackgroundWorkerMetadataForStorage.server";
@@ -17,7 +16,7 @@ export async function findOrCreateBackgroundWorker(
1716
environment: AuthenticatedEnvironment,
1817
deployment: WorkerDeployment,
1918
body: CreateBackgroundWorkerRequestBody,
20-
prisma: PrismaClientOrTransaction = defaultPrisma
19+
prisma: PrismaClientOrTransaction
2120
): Promise<BackgroundWorker> {
2221
const existing = await prisma.backgroundWorker.findFirst({
2322
where: {

0 commit comments

Comments
 (0)