File tree Expand file tree Collapse file tree
apps/webapp/app/runEngine/services
internal-packages/run-engine/src/engine/systems Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -576,6 +576,13 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
576576
577577 //triggered all the runs
578578 if ( updatedBatch . processingJobsCount >= updatedBatch . runCount ) {
579+ logger . debug ( "[RunEngineBatchTrigger][processBatchTaskRun] All runs created" , {
580+ batchId : batch . friendlyId ,
581+ processingJobsCount : updatedBatch . processingJobsCount ,
582+ runCount : updatedBatch . runCount ,
583+ workingIndex,
584+ } ) ;
585+
579586 //if all the runs were idempotent, it's possible the batch is already completed
580587 await this . _engine . tryCompleteBatch ( { batchId : batch . id } ) ;
581588 }
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export class BatchSystem {
4242 select : {
4343 status : true ,
4444 runtimeEnvironmentId : true ,
45+ processingJobsCount : true ,
46+ runCount : true ,
4547 } ,
4648 where : {
4749 id : batchId ,
@@ -58,6 +60,15 @@ export class BatchSystem {
5860 return ;
5961 }
6062
63+ if ( batch . processingJobsCount < batch . runCount ) {
64+ this . $ . logger . debug ( "#tryCompleteBatch: Not all runs are created yet" , {
65+ batchId,
66+ processingJobsCount : batch . processingJobsCount ,
67+ runCount : batch . runCount ,
68+ } ) ;
69+ return ;
70+ }
71+
6172 const runs = await this . $ . prisma . taskRun . findMany ( {
6273 select : {
6374 id : true ,
You can’t perform that action at this time.
0 commit comments