From 124bc3376fdce29c257f809ec8cc21664876cef0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 6 Apr 2026 15:53:28 +0530 Subject: [PATCH] Use argv for coroutine HTTP detection --- app/init/registers.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/init/registers.php b/app/init/registers.php index 947b88d637..5379d21294 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -245,12 +245,7 @@ $register->set('pools', function () { $maxConnections = (int) System::getEnv('_APP_CONNECTIONS_MAX', 151); $instanceConnections = $maxConnections / (int) System::getEnv('_APP_POOL_CLIENTS', 14); - $scriptPath = (string) ($_SERVER['SCRIPT_FILENAME'] ?? ''); - if ($scriptPath === '') { - $scriptPath = (string) ($_SERVER['argv'][0] ?? ''); - } - - $scriptPath = \str_replace('\\', '/', $scriptPath); + $scriptPath = \str_replace('\\', '/', (string) ($_SERVER['argv'][0] ?? '')); $isCoroutineHttp = $scriptPath === 'app/http.php' || \str_ends_with($scriptPath, '/app/http.php'); $workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));