File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed 
apps/webapp/app/v3/services 
references/v3-catalog/src/trigger Expand file tree Collapse file tree 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 {
5151      return  "ERROR" ; 
5252    } 
5353
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+ 
5471    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] " ,  { 
5673        batchRunId : batchRun . id , 
5774        batchRun : { 
5875          id : batchRun . id , 
Original file line number Diff line number Diff line change @@ -376,10 +376,18 @@ export const batchV2TestTask = task({
376376
377377      for  await  ( const  liveRun0  of  runs . subscribeToRun ( response1 . runs [ 0 ] . id ) )  { 
378378        logger . debug ( "subscribed to run0" ,  {  liveRun0 } ) ; 
379+ 
380+         if  ( liveRun0 . finishedAt )  { 
381+           break ; 
382+         } 
379383      } 
380384
381385      for  await  ( const  liveRun1  of  runs . subscribeToRun ( response1 . runs [ 1 ] . id ) )  { 
382386        logger . debug ( "subscribed to run1" ,  {  liveRun1 } ) ; 
387+ 
388+         if  ( liveRun1 . finishedAt )  { 
389+           break ; 
390+         } 
383391      } 
384392    } ) ; 
385393
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments