@@ -17,11 +17,15 @@ export class CreateCheckpointService extends BaseService {
17
17
>
18
18
) : Promise <
19
19
| {
20
+ success : true ;
20
21
checkpoint : Checkpoint ;
21
22
event : CheckpointRestoreEvent ;
22
23
keepRunAlive : boolean ;
23
24
}
24
- | undefined
25
+ | {
26
+ success : false ;
27
+ keepRunAlive ?: boolean ;
28
+ }
25
29
> {
26
30
logger . debug ( `Creating checkpoint` , params ) ;
27
31
@@ -46,7 +50,10 @@ export class CreateCheckpointService extends BaseService {
46
50
47
51
if ( ! attempt ) {
48
52
logger . error ( "Attempt not found" , { attemptFriendlyId : params . attemptFriendlyId } ) ;
49
- return ;
53
+
54
+ return {
55
+ success : false ,
56
+ } ;
50
57
}
51
58
52
59
if (
@@ -64,14 +71,10 @@ export class CreateCheckpointService extends BaseService {
64
71
} ,
65
72
} ) ;
66
73
67
- // This should only affect CLIs < beta.24, in very limited scenarios
68
- const service = new CrashTaskRunService ( this . _prisma ) ;
69
- await service . call ( attempt . taskRunId , {
70
- crashAttempts : true ,
71
- reason : "Unfreezable state: Please upgrade your CLI" ,
72
- } ) ;
73
-
74
- return ;
74
+ return {
75
+ success : false ,
76
+ keepRunAlive : true ,
77
+ } ;
75
78
}
76
79
77
80
const imageRef = attempt . backgroundWorker . deployment ?. imageReference ;
@@ -81,7 +84,10 @@ export class CreateCheckpointService extends BaseService {
81
84
attemptId : attempt . id ,
82
85
workerId : attempt . backgroundWorker . id ,
83
86
} ) ;
84
- return ;
87
+
88
+ return {
89
+ success : false ,
90
+ } ;
85
91
}
86
92
87
93
const checkpoint = await this . _prisma . checkpoint . create ( {
@@ -175,7 +181,10 @@ export class CreateCheckpointService extends BaseService {
175
181
checkpointId : checkpoint . id ,
176
182
} ) ;
177
183
await marqs ?. acknowledgeMessage ( attempt . taskRunId ) ;
178
- return ;
184
+
185
+ return {
186
+ success : false ,
187
+ } ;
179
188
}
180
189
181
190
if ( reason . type === "WAIT_FOR_DURATION" ) {
@@ -191,6 +200,7 @@ export class CreateCheckpointService extends BaseService {
191
200
}
192
201
193
202
return {
203
+ success : true ,
194
204
checkpoint,
195
205
event : checkpointEvent ,
196
206
keepRunAlive,
0 commit comments