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 {
564564 runIds : {
565565 push : runIds ,
566566 } ,
567+ processingJobsCount : {
568+ increment : runIds . length ,
569+ } ,
570+ } ,
571+ select : {
572+ processingJobsCount : true ,
573+ runCount : true ,
567574 } ,
568575 } ) ;
569576
570- // if there are more items to process, requeue the batch
571- if ( workingIndex < batch . runCount ) {
572- return { status : "INCOMPLETE" , workingIndex } ;
573- }
574-
575577 //triggered all the runs
576- if ( updatedBatch . runIds . length == = updatedBatch . runCount ) {
578+ if ( updatedBatch . processingJobsCount > = updatedBatch . runCount ) {
577579 //if all the runs were idempotent, it's possible the batch is already completed
578580 await this . _engine . tryCompleteBatch ( { batchId : batch . id } ) ;
579581 }
580582
583+ // if there are more items to process, requeue the batch
584+ if ( workingIndex < batch . runCount ) {
585+ return { status : "INCOMPLETE" , workingIndex } ;
586+ }
587+
581588 return { status : "COMPLETE" } ;
582589 }
583590
You can’t perform that action at this time.
0 commit comments