File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { AuthenticatedEnvironment } from "~/services/apiAuth.server";
7
7
import { ResumeTaskRunDependenciesService } from "./resumeTaskRunDependencies.server" ;
8
8
import { CRASHABLE_ATTEMPT_STATUSES , isCrashableRunStatus } from "../taskStatus" ;
9
9
import { sanitizeError } from "@trigger.dev/core/v3" ;
10
+ import { FinalizeTaskRunService } from "./finalizeTaskRun.server" ;
10
11
11
12
export type CrashTaskRunServiceOptions = {
12
13
reason ?: string ;
@@ -59,18 +60,12 @@ export class CrashTaskRunService extends BaseService {
59
60
- logs/stacktrace
60
61
*/
61
62
62
- // Remove the task run from the queue if it's there for some reason
63
- await marqs ?. acknowledgeMessage ( taskRun . id ) ;
64
-
65
- // Set the task run status to crashed
66
- const crashedTaskRun = await this . _prisma . taskRun . update ( {
67
- where : {
68
- id : taskRun . id ,
69
- } ,
70
- data : {
71
- status : "CRASHED" ,
72
- completedAt : new Date ( ) ,
73
- } ,
63
+ const finalizeService = new FinalizeTaskRunService ( ) ;
64
+ const crashedTaskRun = await finalizeService . call ( {
65
+ tx : this . _prisma ,
66
+ id : taskRun . id ,
67
+ status : "CRASHED" ,
68
+ completedAt : new Date ( ) ,
74
69
include : {
75
70
attempts : {
76
71
where : {
You can’t perform that action at this time.
0 commit comments