diff --git a/src/Components/swoole/src/Worker/SwooleWorkerHandler.php b/src/Components/swoole/src/Worker/SwooleWorkerHandler.php index 65ad79c013..9c18b4e688 100644 --- a/src/Components/swoole/src/Worker/SwooleWorkerHandler.php +++ b/src/Components/swoole/src/Worker/SwooleWorkerHandler.php @@ -165,7 +165,14 @@ public function getMasterPid(): int /** @var ISwooleServer $server */ $server = ServerManager::getServer('main', ISwooleServer::class); - return $server->getSwooleServer()->master_pid; + if (\SWOOLE_BASE === $server->getSwooleServer()->mode) + { + return $this->getManagerPid(); + } + else + { + return $this->getMasterPid(); + } } /**