File tree 2 files changed +26
-1
lines changed
apps/webapp/app/v3/services
references/v3-catalog/src/trigger 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,25 @@ export class ResumeBatchRunService extends BaseService {
51
51
return "ERROR" ;
52
52
}
53
53
54
+ if ( batchRun . batchVersion === "v2" ) {
55
+ // Make sure batchRun.items.length is equal to or greater than batchRun.runCount
56
+ if ( batchRun . items . length < batchRun . runCount ) {
57
+ logger . debug ( "ResumeBatchRunService: All items aren't yet completed [v2]" , {
58
+ batchRunId : batchRun . id ,
59
+ batchRun : {
60
+ id : batchRun . id ,
61
+ status : batchRun . status ,
62
+ itemsLength : batchRun . items . length ,
63
+ runCount : batchRun . runCount ,
64
+ } ,
65
+ } ) ;
66
+
67
+ return "PENDING" ;
68
+ }
69
+ }
70
+
54
71
if ( batchRun . items . some ( ( item ) => ! finishedBatchRunStatuses . includes ( item . status ) ) ) {
55
- logger . debug ( "ResumeBatchRunService: All items aren't yet completed" , {
72
+ logger . debug ( "ResumeBatchRunService: All items aren't yet completed [v1] " , {
56
73
batchRunId : batchRun . id ,
57
74
batchRun : {
58
75
id : batchRun . id ,
Original file line number Diff line number Diff line change @@ -376,10 +376,18 @@ export const batchV2TestTask = task({
376
376
377
377
for await ( const liveRun0 of runs . subscribeToRun ( response1 . runs [ 0 ] . id ) ) {
378
378
logger . debug ( "subscribed to run0" , { liveRun0 } ) ;
379
+
380
+ if ( liveRun0 . finishedAt ) {
381
+ break ;
382
+ }
379
383
}
380
384
381
385
for await ( const liveRun1 of runs . subscribeToRun ( response1 . runs [ 1 ] . id ) ) {
382
386
logger . debug ( "subscribed to run1" , { liveRun1 } ) ;
387
+
388
+ if ( liveRun1 . finishedAt ) {
389
+ break ;
390
+ }
383
391
}
384
392
} ) ;
385
393
You can’t perform that action at this time.
0 commit comments