File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1414class ConsoleApplicationRunner implements RunnerInterface
1515{
1616 private $ handler ;
17+ private $ loopMax ;
1718
18- public function __construct (Application $ application )
19+ public function __construct (Application $ application, int $ loopMax = 1 )
1920 {
2021 $ this ->handler = new ConsoleApplicationHandler ($ application );
22+ $ this ->loopMax = $ loopMax ;
2123 }
2224
2325 public function run (): int
2426 {
2527 $ lambda = LambdaClient::fromEnvironmentVariable ('symfony-runtime-console ' );
2628
29+ $ loops = 0 ;
2730 while (true ) {
31+ if (++$ loops > $ this ->loopMax ) {
32+ return 0 ;
33+ }
34+
2835 /*
2936 * In case the execution failed, we force starting a new process. This
3037 * is because an uncaught exception could have left the application
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ private function tryToFindRunner(?object $application)
9494 }
9595
9696 if ($ application instanceof Application) {
97- return new ConsoleApplicationRunner ($ application );
97+ return new ConsoleApplicationRunner ($ application, $ this -> options [ ' bref_loop_max ' ] );
9898 }
9999
100100 return parent ::getRunner ($ application );
You can’t perform that action at this time.
0 commit comments