Skip to content

Commit 3e63357

Browse files
committed
fix: use $transaction helper instead of prisma.$transaction for PrismaClientOrTransaction compatibility
1 parent ceb6391 commit 3e63357

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { BackgroundWorkerId } from "@trigger.dev/core/v3/isomorphic";
1010
import type { BackgroundWorker, TaskQueue, TaskQueueType } from "@trigger.dev/database";
1111
import cronstrue from "cronstrue";
12-
import { Prisma, PrismaClientOrTransaction } from "~/db.server";
12+
import { $transaction, Prisma, PrismaClientOrTransaction } from "~/db.server";
1313
import { sanitizeQueueName } from "~/models/taskQueue.server";
1414
import { AuthenticatedEnvironment } from "~/services/apiAuth.server";
1515
import { logger } from "~/services/logger.server";
@@ -788,7 +788,7 @@ async function createWorkerPrompts(
788788

789789
// Wrap label removal + version creation in a transaction so labels
790790
// aren't stripped if the create fails (e.g. concurrent deploy race).
791-
await prisma.$transaction(async (tx) => {
791+
await $transaction(prisma, async (tx) => {
792792
// Remove "latest" label from all existing versions
793793
if (latestVersion) {
794794
await tx.$executeRaw`

0 commit comments

Comments
 (0)