File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
apps/webapp/app/services/runs
references/job-catalog/src Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ export class ContinueRunService {
45
45
} ,
46
46
} ) ;
47
47
48
+ // Delete any tasks that are errored
49
+ await tx . task . deleteMany ( {
50
+ where : {
51
+ runId : runId ,
52
+ status : "ERRORED" ,
53
+ } ,
54
+ } ) ;
55
+
48
56
await ResumeRunService . enqueue ( run , tx ) ;
49
57
} ,
50
58
{ timeout : 10000 }
Original file line number Diff line number Diff line change @@ -153,4 +153,26 @@ client.defineJob({
153
153
} ,
154
154
} ) ;
155
155
156
+ client . defineJob ( {
157
+ id : "retry-with-failed-errors" ,
158
+ name : "Retry with failed errors" ,
159
+ version : "1.0.0" ,
160
+ trigger : eventTrigger ( {
161
+ name : "foo.bar" ,
162
+ } ) ,
163
+ run : async ( payload , io , ctx ) => {
164
+ await io . logger . info ( "Hello World" , { ctx, payload } ) ;
165
+
166
+ return await io . runTask ( "task-example-1" , async ( ) => {
167
+ if ( Math . random ( ) > 0.5 ) {
168
+ throw new Error ( "Failed on purpose" ) ;
169
+ }
170
+
171
+ return {
172
+ message : "Hello World" ,
173
+ } ;
174
+ } ) ;
175
+ } ,
176
+ } ) ;
177
+
156
178
createExpressServer ( client ) ;
You can’t perform that action at this time.
0 commit comments