File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 14
14
class ConsoleApplicationRunner implements RunnerInterface
15
15
{
16
16
private $ handler ;
17
+ private $ loopMax ;
17
18
18
- public function __construct (Application $ application )
19
+ public function __construct (Application $ application, int $ loopMax = 1 )
19
20
{
20
21
$ this ->handler = new ConsoleApplicationHandler ($ application );
22
+ $ this ->loopMax = $ loopMax ;
21
23
}
22
24
23
25
public function run (): int
24
26
{
25
27
$ lambda = LambdaClient::fromEnvironmentVariable ('symfony-runtime-console ' );
26
28
29
+ $ loops = 0 ;
27
30
while (true ) {
31
+ if (++$ loops > $ this ->loopMax ) {
32
+ return 0 ;
33
+ }
34
+
28
35
/*
29
36
* In case the execution failed, we force starting a new process. This
30
37
* 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)
94
94
}
95
95
96
96
if ($ application instanceof Application) {
97
- return new ConsoleApplicationRunner ($ application );
97
+ return new ConsoleApplicationRunner ($ application, $ this -> options [ ' bref_loop_max ' ] );
98
98
}
99
99
100
100
return parent ::getRunner ($ application );
You can’t perform that action at this time.
0 commit comments