diff --git a/src/Components/workerman-gateway/src/Swoole/Listener/AppRunListener.php b/src/Components/workerman-gateway/src/Swoole/Listener/AppRunListener.php index 5ac500aa21..f35e51219d 100644 --- a/src/Components/workerman-gateway/src/Swoole/Listener/AppRunListener.php +++ b/src/Components/workerman-gateway/src/Swoole/Listener/AppRunListener.php @@ -25,6 +25,11 @@ public function handle(EventParam $e): void if ($registerAddress = Config::get('@app.mainServer.workermanGateway.registerAddress')) { Gateway::$registerAddress = $registerAddress; + // @phpstan-ignore-next-line + if (isset(Gateway::$persistentConnection)) + { + Gateway::$persistentConnection = false; + } } } } diff --git a/src/Components/workerman-gateway/src/Swoole/Server/Business/TcpBusinessServer.php b/src/Components/workerman-gateway/src/Swoole/Server/Business/TcpBusinessServer.php index d4b045257e..18176cbd91 100644 --- a/src/Components/workerman-gateway/src/Swoole/Server/Business/TcpBusinessServer.php +++ b/src/Components/workerman-gateway/src/Swoole/Server/Business/TcpBusinessServer.php @@ -65,6 +65,11 @@ protected function initGatewayWorker(): void if (isset($workermanGatewayConfig['registerAddress'])) { Gateway::$registerAddress = $workermanGatewayConfig['registerAddress']; + // @phpstan-ignore-next-line + if (isset(Gateway::$persistentConnection)) + { + Gateway::$persistentConnection = false; + } } Coroutine::create(function () use ($workermanGatewayConfig) { diff --git a/src/Components/workerman-gateway/src/Swoole/Server/Business/WebSocketBusinessServer.php b/src/Components/workerman-gateway/src/Swoole/Server/Business/WebSocketBusinessServer.php index 3f23e12189..5d77bb097f 100644 --- a/src/Components/workerman-gateway/src/Swoole/Server/Business/WebSocketBusinessServer.php +++ b/src/Components/workerman-gateway/src/Swoole/Server/Business/WebSocketBusinessServer.php @@ -65,6 +65,11 @@ protected function initGatewayWorker(): void if (isset($workermanGatewayConfig['registerAddress'])) { Gateway::$registerAddress = $workermanGatewayConfig['registerAddress']; + // @phpstan-ignore-next-line + if (isset(Gateway::$persistentConnection)) + { + Gateway::$persistentConnection = false; + } } Coroutine::create(function () use ($workermanGatewayConfig) { diff --git a/src/Components/workerman-gateway/src/Workerman/Listener/AppRunListener.php b/src/Components/workerman-gateway/src/Workerman/Listener/AppRunListener.php index 716fabe8bd..4cfc74a734 100644 --- a/src/Components/workerman-gateway/src/Workerman/Listener/AppRunListener.php +++ b/src/Components/workerman-gateway/src/Workerman/Listener/AppRunListener.php @@ -27,6 +27,11 @@ public function handle(EventParam $e): void if (isset($item['configs']['registerAddress'])) { Gateway::$registerAddress = $item['configs']['registerAddress']; + // @phpstan-ignore-next-line + if (isset(Gateway::$persistentConnection)) + { + Gateway::$persistentConnection = false; + } break; } } diff --git a/src/Components/workerman/src/Server/Base.php b/src/Components/workerman/src/Server/Base.php index b79d94f606..128e2aaadb 100644 --- a/src/Components/workerman/src/Server/Base.php +++ b/src/Components/workerman/src/Server/Base.php @@ -339,6 +339,11 @@ protected function bindEvents(): void if (isset($config['configs']['registerAddress']) && class_exists(Gateway::class)) { Gateway::$registerAddress = $config['configs']['registerAddress']; + // @phpstan-ignore-next-line + if (isset(Gateway::$persistentConnection)) + { + Gateway::$persistentConnection = false; + } } Event::trigger('IMI.WORKERMAN.SERVER.WORKER_START', [