File tree Expand file tree Collapse file tree 1 file changed +8
-27
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +8
-27
lines changed Original file line number Diff line number Diff line change 1
1
import { logger } from "~/services/logger.server" ;
2
- import { marqs } from "~/v3/marqs/index.server" ;
3
2
import { BaseService } from "./baseService.server" ;
4
3
import { eventRepository } from "../eventRepository.server" ;
4
+ import { FinalizeTaskRunService } from "./finalizeTaskRun.server" ;
5
5
6
6
export class ExpireEnqueuedRunService extends BaseService {
7
7
public async call ( runId : string ) {
@@ -39,30 +39,13 @@ export class ExpireEnqueuedRunService extends BaseService {
39
39
run,
40
40
} ) ;
41
41
42
- /*
43
- "EXPIRED"
44
-
45
- Steps:
46
- 1. Updates the run to expired, with dates
47
- 2. Completes the run span OTEL event
48
- 3. marqs ack
49
-
50
- Inputs:
51
- - taskRun: id, spanId, ttl
52
-
53
- Questions:
54
- - Why do we ack after the db update?
55
- */
56
-
57
- await this . _prisma . taskRun . update ( {
58
- where : {
59
- id : run . id ,
60
- } ,
61
- data : {
62
- status : "EXPIRED" ,
63
- expiredAt : new Date ( ) ,
64
- completedAt : new Date ( ) ,
65
- } ,
42
+ const finalizeService = new FinalizeTaskRunService ( ) ;
43
+ await finalizeService . call ( {
44
+ tx : this . _prisma ,
45
+ id : run . id ,
46
+ status : "EXPIRED" ,
47
+ expiredAt : new Date ( ) ,
48
+ completedAt : new Date ( ) ,
66
49
} ) ;
67
50
68
51
await eventRepository . completeEvent ( run . spanId , {
@@ -82,7 +65,5 @@ export class ExpireEnqueuedRunService extends BaseService {
82
65
} ,
83
66
] ,
84
67
} ) ;
85
-
86
- await marqs ?. acknowledgeMessage ( run . id ) ;
87
68
}
88
69
}
You can’t perform that action at this time.
0 commit comments