File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { marqs } from "~/v3/marqs/index.server";
99import { socketIo } from "../handleSocketIo.server" ;
1010import { sharedQueueTasks } from "../marqs/sharedQueueConsumer.server" ;
1111import { BaseService } from "./baseService.server" ;
12- import { TaskRunAttempt } from "@trigger.dev/database" ;
12+ import { Prisma , TaskRunAttempt } from "@trigger.dev/database" ;
1313import { FINAL_ATTEMPT_STATUSES , FINAL_RUN_STATUSES , isFinalRunStatus } from "../taskStatus" ;
1414
1515export class ResumeAttemptService extends BaseService {
@@ -20,6 +20,16 @@ export class ResumeAttemptService extends BaseService {
2020 ) : Promise < void > {
2121 this . _logger . debug ( `ResumeAttemptService.call()` , params ) ;
2222
23+ const latestAttemptSelect = {
24+ orderBy : {
25+ number : "desc" ,
26+ } ,
27+ take : 1 ,
28+ select : {
29+ id : true ,
30+ } ,
31+ } satisfies Prisma . TaskRunInclude [ "attempts" ] ;
32+
2333 const attempt = await this . _prisma . taskRunAttempt . findFirst ( {
2434 where : {
2535 friendlyId : params . attemptFriendlyId ,
@@ -30,15 +40,7 @@ export class ResumeAttemptService extends BaseService {
3040 include : {
3141 taskRun : {
3242 include : {
33- attempts : {
34- orderBy : {
35- number : "desc" ,
36- } ,
37- take : 1 ,
38- select : {
39- id : true ,
40- } ,
41- } ,
43+ attempts : latestAttemptSelect ,
4244 } ,
4345 } ,
4446 } ,
@@ -53,15 +55,7 @@ export class ResumeAttemptService extends BaseService {
5355 include : {
5456 taskRun : {
5557 include : {
56- attempts : {
57- orderBy : {
58- number : "desc" ,
59- } ,
60- take : 1 ,
61- select : {
62- id : true ,
63- } ,
64- } ,
58+ attempts : latestAttemptSelect ,
6559 } ,
6660 } ,
6761 } ,
You can’t perform that action at this time.
0 commit comments