Skip to content

Commit ba45740

Browse files
authored
frankenphp: don't stop the worker script even if a connection with a client is aborted (#155)
See php/frankenphp#316 and php/frankenphp#310 (comment).
1 parent 6d36a65 commit ba45740

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/frankenphp-symfony/src/Runner.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public function __construct(private HttpKernelInterface $kernel)
2222

2323
public function run(): int
2424
{
25+
// Prevent worker script termination when a client connection is interrupted
26+
ignore_user_abort(true);
27+
2528
$server = array_filter($_SERVER, static fn (string $key) => !str_starts_with($key, 'HTTP_'), ARRAY_FILTER_USE_KEY);
2629
$server['APP_RUNTIME_MODE'] = 'web=1&worker=1';
2730

0 commit comments

Comments
 (0)