1414
1515class CleanupRunService {
1616
17- private const DEFAULT_APPLY_LIMIT = 25 ;
18- private const MAX_APPLY_LIMIT = 100 ;
17+ private const DEFAULT_APPLY_LIMIT = 25 ;
18+ private const MAX_APPLY_LIMIT = 100 ;
1919 private const WORKTREE_APPLY_BATCH_LIMIT = 1 ;
2020
2121
@@ -102,9 +102,9 @@ public function apply( string $run_id, array $opts = array() ): array|\WP_Error
102102 $ results = array ();
103103
104104 if ( array () !== $ artifact_rows ) {
105- $ artifact_batch = array_slice ($ artifact_rows , 0 , $ limit );
106- $ processed_rows += count ($ artifact_batch );
107- $ batch_type = 'artifact_cleanup ' ;
105+ $ artifact_batch = array_slice ($ artifact_rows , 0 , $ limit );
106+ $ processed_rows += count ($ artifact_batch );
107+ $ batch_type = 'artifact_cleanup ' ;
108108 $ this ->mark_batch_applying ($ artifact_batch , $ run_id , $ batch_type , $ limit , $ remaining_rows );
109109 $ results ['artifact_cleanup ' ] = $ this ->workspace ->worktree_cleanup_artifacts (
110110 array (
@@ -118,9 +118,9 @@ public function apply( string $run_id, array $opts = array() ): array|\WP_Error
118118
119119 $ remaining_capacity = max (0 , $ limit - $ processed_rows );
120120 if ( $ remaining_capacity > 0 && array () !== $ worktree_rows ) {
121- $ worktree_batch = array_slice ($ worktree_rows , 0 , min ($ remaining_capacity , self ::WORKTREE_APPLY_BATCH_LIMIT ));
122- $ processed_rows += count ($ worktree_batch );
123- $ batch_type = '' === $ batch_type ? 'worktree_removal ' : 'mixed ' ;
121+ $ worktree_batch = array_slice ($ worktree_rows , 0 , min ($ remaining_capacity , self ::WORKTREE_APPLY_BATCH_LIMIT ));
122+ $ processed_rows += count ($ worktree_batch );
123+ $ batch_type = '' === $ batch_type ? 'worktree_removal ' : 'mixed ' ;
124124 $ this ->mark_batch_applying ($ worktree_batch , $ run_id , $ batch_type , $ limit , $ remaining_rows );
125125 $ results ['worktree_removal ' ] = $ this ->workspace ->worktree_cleanup_merged (
126126 array (
0 commit comments