File tree Expand file tree Collapse file tree 4 files changed +19
-9
lines changed
Expand file tree Collapse file tree 4 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 11### master
22
3+ - Fix ` StartCondition::isCanceled() ` when a previous process has been canceled
4+
35### [ 0.7.2] ( ../../compare/0.7.1...0.7.2 ) - 2022-03-08
46
57- Fix start ready processes when maximum paralell processes is not configured or value is ` null `
Original file line number Diff line number Diff line change 1919 "require-dev" : {
2020 "ext-simplexml" : " *" ,
2121 "phpunit/phpunit" : " 9.5.*" ,
22- "symfony/var-dumper" : " 5.3 .*"
22+ "symfony/var-dumper" : " 5.4 .*"
2323 },
2424 "autoload" : {
2525 "psr-4" : {
Original file line number Diff line number Diff line change @@ -177,29 +177,31 @@ protected function startProcesses(): self
177177 protected function waitProcessesTermination (OutputInterface $ output ): self
178178 {
179179 $ terminated = 0 ;
180- while ($ terminated !== count ( $ this ->getProcesses ())) {
180+ while ($ terminated < $ this ->getProcesses ()-> count ( )) {
181181 if ($ this ->isCanceled ()) {
182182 break ;
183183 }
184184
185185 $ terminated = 0 ;
186186
187+ $ this
188+ ->startReadyProcesses ()
189+ ->defineCanceledProcesses ();
190+
187191 foreach ($ this ->getProcesses ()->toArray () as $ process ) {
188192 if ($ process ->isCanceled () || $ process ->isTerminated ()) {
189193 $ terminated ++;
190194 }
191195 }
192196
193- $ this
194- ->startReadyProcesses ()
195- ->defineCanceledProcesses ();
196-
197197 $ this
198198 ->getTheme ()
199199 ->resetOutput ($ output , $ this ->getProcesses ())
200200 ->outputProcessesState ($ output , $ this ->getProcesses ());
201201
202- usleep ($ this ->getRefreshInterval ());
202+ if ($ terminated < $ this ->getProcesses ()->count ()) {
203+ usleep ($ this ->getRefreshInterval ());
204+ }
203205 }
204206
205207 return $ this ;
Original file line number Diff line number Diff line change @@ -106,15 +106,21 @@ public function isCanceled(): bool
106106 $ return = false ;
107107
108108 foreach ($ this ->getProcessesSuccessful ()->toArray () as $ successfulProcess ) {
109- if ($ successfulProcess ->isTerminated () && $ successfulProcess ->isSuccessful () === false ) {
109+ if (
110+ ($ successfulProcess ->isTerminated () && $ successfulProcess ->isSuccessful () === false )
111+ || $ successfulProcess ->isCanceled ()
112+ ) {
110113 $ return = true ;
111114 break ;
112115 }
113116 }
114117
115118 if ($ return === false ) {
116119 foreach ($ this ->getProcessesFailed ()->toArray () as $ failedProcess ) {
117- if ($ failedProcess ->isTerminated () && $ failedProcess ->isSuccessful ()) {
120+ if (
121+ ($ failedProcess ->isTerminated () && $ failedProcess ->isSuccessful ())
122+ || $ failedProcess ->isCanceled ()
123+ ) {
118124 $ return = true ;
119125 break ;
120126 }
You can’t perform that action at this time.
0 commit comments