Skip to content

Commit 065c5c9

Browse files
committed
CompletedAttempt “SYSTEM_FAILURE”
1 parent 868ba40 commit 065c5c9

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

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

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -269,34 +269,14 @@ export class CompleteAttemptService extends BaseService {
269269
if (!checkpointCreateResult) {
270270
logger.error("Failed to create checkpoint", { checkpoint, execution: execution.run.id });
271271

272-
/*
273-
"SYSTEM_FAILURE"
274-
275-
Steps:
276-
1. Updates the run to system failure
277-
2. marqs ack
278-
279-
Inputs:
280-
- taskRun: id, friendlyId
281-
282-
Questions:
283-
- Nothing with OTEL events?
284-
- Why do we ack after the db update?
285-
*/
286-
287-
// Update the task run to be failed
288-
await this._prisma.taskRun.update({
289-
where: {
290-
friendlyId: execution.run.id,
291-
},
292-
data: {
293-
status: "SYSTEM_FAILURE",
294-
completedAt: new Date(),
295-
},
272+
const finalizeService = new FinalizeTaskRunService();
273+
await finalizeService.call({
274+
tx: this._prisma,
275+
id: taskRunAttempt.taskRunId,
276+
status: "SYSTEM_FAILURE",
277+
completedAt: new Date(),
296278
});
297279

298-
await marqs?.acknowledgeMessage(taskRunAttempt.taskRunId);
299-
300280
return "COMPLETED";
301281
}
302282

0 commit comments

Comments
 (0)