Skip to content

Commit 789d4e9

Browse files
committed
Remove unnecessary prisma tx params from enqueue methods
1 parent 7553d8c commit 789d4e9

9 files changed

+16
-30
lines changed

apps/webapp/app/runEngine/services/batchTrigger.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
313313
}
314314
}
315315

316-
async #enqueueBatchTaskRun(options: BatchProcessingOptions, tx?: PrismaClientOrTransaction) {
316+
async #enqueueBatchTaskRun(options: BatchProcessingOptions) {
317317
await commonWorker.enqueue({
318318
id: `RunEngineBatchTriggerService.process:${options.batchId}:${options.processingId}`,
319319
job: "runengine.processBatchTaskRun",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ export class BatchTriggerV3Service extends BaseService {
891891
return false;
892892
}
893893

894-
async #enqueueBatchTaskRun(options: BatchProcessingOptions, tx?: PrismaClientOrTransaction) {
894+
async #enqueueBatchTaskRun(options: BatchProcessingOptions) {
895895
await commonWorker.enqueue({
896896
id: `BatchTriggerV2Service.process:${options.batchId}:${options.processingId}`,
897897
job: "v3.processBatchTaskRun",

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { commonWorker } from "../commonWorker.server";
2-
import { BaseService } from "./baseService.server";
3-
import { PrismaClientOrTransaction } from "~/db.server";
41
import { z } from "zod";
2+
import { findLatestSession } from "~/models/runtimeEnvironment.server";
53
import { logger } from "~/services/logger.server";
4+
import { commonWorker } from "../commonWorker.server";
5+
import { BaseService } from "./baseService.server";
66
import { CancelTaskRunService } from "./cancelTaskRun.server";
7-
import { findLatestSession } from "~/models/runtimeEnvironment.server";
87

98
export const CancelDevSessionRunsServiceOptions = z.object({
109
runIds: z.array(z.string()),
@@ -90,11 +89,7 @@ export class CancelDevSessionRunsService extends BaseService {
9089
}
9190
}
9291

93-
static async enqueue(
94-
options: CancelDevSessionRunsServiceOptions,
95-
runAt?: Date,
96-
tx?: PrismaClientOrTransaction
97-
) {
92+
static async enqueue(options: CancelDevSessionRunsServiceOptions, runAt?: Date) {
9893
return await commonWorker.enqueue({
9994
id: options.cancelledSessionId
10095
? `cancelDevSessionRuns:${options.cancelledSessionId}`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ export class CompleteAttemptService extends BaseService {
482482

483483
const retryDirectly = () => {
484484
logger.debug("[CompleteAttemptService] Retrying attempt directly", { runId: run.id });
485-
return RetryAttemptService.enqueue(run.id, this._prisma, new Date(executionRetry.timestamp));
485+
return RetryAttemptService.enqueue(run.id, new Date(executionRetry.timestamp));
486486
};
487487

488488
// There's a checkpoint, so we need to go through the queue

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ export class CreateDeploymentBackgroundWorkerServiceV4 extends BaseService {
167167
deployment.id,
168168
"DEPLOYING",
169169
"Indexing timed out",
170-
new Date(Date.now() + env.DEPLOY_TIMEOUT_MS),
171-
this._prisma
170+
new Date(Date.now() + env.DEPLOY_TIMEOUT_MS)
172171
);
173172

174173
return backgroundWorker;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class ResumeDependentParentsService extends BaseService {
180180
}
181181

182182
//resume the dependent task
183-
await ResumeTaskDependencyService.enqueue(dependency.id, lastAttempt.id, this._prisma);
183+
await ResumeTaskDependencyService.enqueue(dependency.id, lastAttempt.id);
184184
return {
185185
success: true,
186186
action: "resume-scheduled",

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { PrismaClientOrTransaction } from "~/db.server";
1+
import { TaskRunDependency } from "@trigger.dev/database";
22
import { logger } from "~/services/logger.server";
3-
import { commonWorker } from "../commonWorker.server";
43
import { marqs } from "~/v3/marqs/index.server";
4+
import { commonWorker } from "../commonWorker.server";
55
import { BaseService } from "./baseService.server";
6-
import { TaskRunDependency } from "@trigger.dev/database";
76

87
export class ResumeTaskDependencyService extends BaseService {
98
public async call(dependencyId: string, sourceTaskAttemptId: string) {
@@ -154,12 +153,7 @@ export class ResumeTaskDependencyService extends BaseService {
154153
}
155154
}
156155

157-
static async enqueue(
158-
dependencyId: string,
159-
sourceTaskAttemptId: string,
160-
tx: PrismaClientOrTransaction,
161-
runAt?: Date
162-
) {
156+
static async enqueue(dependencyId: string, sourceTaskAttemptId: string, runAt?: Date) {
163157
return await commonWorker.enqueue({
164158
job: "v3.resumeTaskDependency",
165159
payload: {

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { BaseService } from "./baseService.server";
21
import { logger } from "~/services/logger.server";
3-
import { socketIo } from "../handleSocketIo.server";
4-
import { PrismaClientOrTransaction } from "~/db.server";
52
import { commonWorker } from "../commonWorker.server";
3+
import { socketIo } from "../handleSocketIo.server";
4+
import { BaseService } from "./baseService.server";
65

76
export class RetryAttemptService extends BaseService {
87
public async call(runId: string) {
@@ -23,7 +22,7 @@ export class RetryAttemptService extends BaseService {
2322
});
2423
}
2524

26-
static async enqueue(runId: string, tx: PrismaClientOrTransaction, runAt?: Date) {
25+
static async enqueue(runId: string, runAt?: Date) {
2726
return await commonWorker.enqueue({
2827
id: `retryAttempt:${runId}`,
2928
job: "v3.retryAttempt",

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ export class TimeoutDeploymentService extends BaseService {
4747
deploymentId: string,
4848
fromStatus: string,
4949
errorMessage: string,
50-
runAt: Date,
51-
tx?: PrismaClientOrTransaction
50+
runAt: Date
5251
) {
5352
await commonWorker.enqueue({
5453
id: `timeoutDeployment:${deploymentId}`,

0 commit comments

Comments
 (0)