File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
apps/webapp/app/runEngine/services Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -564,20 +564,27 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
564
564
runIds : {
565
565
push : runIds ,
566
566
} ,
567
+ processingJobsCount : {
568
+ increment : runIds . length ,
569
+ } ,
570
+ } ,
571
+ select : {
572
+ processingJobsCount : true ,
573
+ runCount : true ,
567
574
} ,
568
575
} ) ;
569
576
570
- // if there are more items to process, requeue the batch
571
- if ( workingIndex < batch . runCount ) {
572
- return { status : "INCOMPLETE" , workingIndex } ;
573
- }
574
-
575
577
//triggered all the runs
576
- if ( updatedBatch . runIds . length == = updatedBatch . runCount ) {
578
+ if ( updatedBatch . processingJobsCount > = updatedBatch . runCount ) {
577
579
//if all the runs were idempotent, it's possible the batch is already completed
578
580
await this . _engine . tryCompleteBatch ( { batchId : batch . id } ) ;
579
581
}
580
582
583
+ // if there are more items to process, requeue the batch
584
+ if ( workingIndex < batch . runCount ) {
585
+ return { status : "INCOMPLETE" , workingIndex } ;
586
+ }
587
+
581
588
return { status : "COMPLETE" } ;
582
589
}
583
590
You can’t perform that action at this time.
0 commit comments