Skip to content

Commit 3669e8e

Browse files
authored
[Bref] Make sure to restart console runner when exception (#111)
* [Bref] Make sure to restart console runner when exception * cs
1 parent 9878719 commit 3669e8e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bref/src/ConsoleApplicationRunner.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ public function run(): int
2525
$lambda = LambdaClient::fromEnvironmentVariable('symfony-runtime-console');
2626

2727
while (true) {
28-
$lambda->processNextEvent($this->handler);
28+
/*
29+
* In case the execution failed, we force starting a new process. This
30+
* is because an uncaught exception could have left the application
31+
* in a non-clean state.
32+
*/
33+
if (!$lambda->processNextEvent($this->handler)) {
34+
return 0;
35+
}
2936
}
3037
}
3138
}

0 commit comments

Comments
 (0)