diff --git a/src/FpmRuntime/FpmHandler.php b/src/FpmRuntime/FpmHandler.php index caa1ef145..3e80e2d36 100644 --- a/src/FpmRuntime/FpmHandler.php +++ b/src/FpmRuntime/FpmHandler.php @@ -197,6 +197,8 @@ private function ensureStillRunning(): void } /** + * @see https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html#runtimes-lifecycle-ib + * * @throws Exception */ private function waitUntilReady(): void @@ -205,6 +207,10 @@ private function waitUntilReady(): void $timeout = 5000000; // 5 secs $elapsed = 0; + if ($_SERVER['BREF_FPM_READY_TIMEOUT'] ?? false) { + $timeout = (int) $_SERVER['BREF_FPM_READY_TIMEOUT']; + } + while (! $this->isReady()) { usleep($wait); $elapsed += $wait;