From 6d1b2b27eb05d23940804c447c74cca69d5641b7 Mon Sep 17 00:00:00 2001 From: evalor Date: Thu, 7 Mar 2019 18:16:49 +0800 Subject: [PATCH] update --- App/WebSocket/WebSocketEvents.php | 2 +- dev.php | 7 +++---- produce.php | 13 ++++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/App/WebSocket/WebSocketEvents.php b/App/WebSocket/WebSocketEvents.php index 95f172e..ef54635 100644 --- a/App/WebSocket/WebSocketEvents.php +++ b/App/WebSocket/WebSocketEvents.php @@ -74,7 +74,7 @@ static function onOpen(\swoole_server $server, \swoole_http_request $req) static function onClose(\swoole_server $server, int $fd, int $reactorId) { $info = $server->connection_info($fd); - if ($info['websocket_status'] !== 0) { + if (isset($info['websocket_status']) && $info['websocket_status'] !== 0) { $redisPool = PoolManager::getInstance()->getPool(RedisPool::class); $redis = $redisPool->getObj(); if ($redis instanceof RedisPoolObject) { diff --git a/dev.php b/dev.php index 4261c14..d3589b4 100644 --- a/dev.php +++ b/dev.php @@ -32,9 +32,8 @@ 'LISTEN_ADDRESS' => '127.0.0.1', 'HOST' => '127.0.0.1', 'PORT' => 9500, - 'EXPIRE' => '120', - 'AUTH' => null, - 'PUSH_LOG' => true, + 'USER' => 'root', + 'PASSWORD' => '123456' ], 'FAST_CACHE' => [ 'PROCESS_NUM' => 0, @@ -49,4 +48,4 @@ 'HOST' => '127.0.0.1', 'PORT' => 6379 ] -]; +]; \ No newline at end of file diff --git a/produce.php b/produce.php index 443c7a8..d9dc5f8 100644 --- a/produce.php +++ b/produce.php @@ -28,13 +28,20 @@ 'LISTEN_ADDRESS' => '127.0.0.1', 'HOST' => '127.0.0.1', 'PORT' => 9500, - 'EXPIRE' => '120', - 'AUTH' => null, - 'PUSH_LOG' => true, + 'USER' => 'root', + 'PASSWORD' => '123456' ], 'FAST_CACHE' => [ 'PROCESS_NUM' => 0, 'BACKLOG' => 256, ], 'DISPLAY_ERROR' => true, + 'SYSTEM' => [ + 'WS_SERVER_PATH' => 'ws://127.0.0.1:9501', + 'LAST_MESSAGE_MAX' => 10 + ], + 'REDIS' => [ + 'HOST' => '127.0.0.1', + 'PORT' => 6379 + ] ];