From 8c8a75b730dd5d4c640f561cf1facac689969172 Mon Sep 17 00:00:00 2001 From: Cidos Date: Wed, 23 Nov 2022 00:52:22 +0800 Subject: [PATCH] perf: ensure timely flush stream buffers Resolve OOM problem while handle a large streamed response --- Factory/PsrHttpFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Factory/PsrHttpFactory.php b/Factory/PsrHttpFactory.php index 61650df..b1b6f9a 100644 --- a/Factory/PsrHttpFactory.php +++ b/Factory/PsrHttpFactory.php @@ -142,7 +142,7 @@ public function createResponse(Response $symfonyResponse) $stream->write($buffer); return ''; - }); + }, 1); $symfonyResponse->sendContent(); ob_end_clean();