File tree Expand file tree Collapse file tree 1 file changed +3
-49
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +3
-49
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,7 @@ export class CreateCheckpointService extends BaseService {
35
35
friendlyId : params . attemptFriendlyId ,
36
36
} ,
37
37
include : {
38
- taskRun : {
39
- include : {
40
- childRuns : {
41
- orderBy : {
42
- createdAt : "asc" ,
43
- } ,
44
- take : 1 ,
45
- } ,
46
- } ,
47
- } ,
38
+ taskRun : true ,
48
39
backgroundWorker : {
49
40
select : {
50
41
id : true ,
@@ -102,45 +93,6 @@ export class CreateCheckpointService extends BaseService {
102
93
} ;
103
94
}
104
95
105
- const { reason } = params ;
106
-
107
- switch ( reason . type ) {
108
- case "WAIT_FOR_TASK" : {
109
- const lastChildRun = attempt . taskRun . childRuns [ 0 ] ;
110
-
111
- if ( ! lastChildRun ) {
112
- logger . warn ( "CreateCheckpointService: No child runs, creating checkpoint regardless" , {
113
- attemptId : attempt . id ,
114
- runId : attempt . taskRunId ,
115
- params,
116
- } ) ;
117
-
118
- break ;
119
- }
120
-
121
- if ( lastChildRun . friendlyId !== reason . friendlyId ) {
122
- logger . error ( "CreateCheckpointService: Checkpoint not for most recent child run" , {
123
- attemptId : attempt . id ,
124
- runId : attempt . taskRunId ,
125
- params,
126
- } ) ;
127
-
128
- return {
129
- success : false ,
130
- keepRunAlive : true ,
131
- } ;
132
- }
133
-
134
- break ;
135
- }
136
- case "WAIT_FOR_BATCH" : {
137
- break ;
138
- }
139
- default : {
140
- break ;
141
- }
142
- }
143
-
144
96
//sleep to test slow checkpoints
145
97
// await new Promise((resolve) => setTimeout(resolve, 60_000));
146
98
@@ -176,6 +128,8 @@ export class CreateCheckpointService extends BaseService {
176
128
} ,
177
129
} ) ;
178
130
131
+ const { reason } = params ;
132
+
179
133
let checkpointEvent : CheckpointRestoreEvent | undefined ;
180
134
181
135
switch ( reason . type ) {
You can’t perform that action at this time.
0 commit comments