From f1767a5d52ec6a43f737a63545d9aa94068a946c Mon Sep 17 00:00:00 2001 From: lin <465382251@qq.com> Date: Fri, 29 Oct 2021 17:52:17 +0800 Subject: [PATCH] wensocket undefined index --- src/Api/WebSocket/SocketServer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/WebSocket/SocketServer.php b/src/Api/WebSocket/SocketServer.php index 00f1a95..f5bc6f2 100644 --- a/src/Api/WebSocket/SocketServer.php +++ b/src/Api/WebSocket/SocketServer.php @@ -175,7 +175,7 @@ private function onMessage($global){ $global->saveQueue($table,$data); }else{ //$global->save($table,$data); - $this->local_global['public'][$table]=$data; + if(isset($this->local_global['public'][$table])) $this->local_global['public'][$table]=$data; //echo date('Y-m-d H:i:s',$data['tick']['ts']/1000).PHP_EOL; //最后数据更新时间 @@ -234,7 +234,7 @@ private function onMessage($global){ $global->saveQueue($table,$data); }else{ //$global->save($table,$data); - $this->local_global['public'][$table]=$data; + if(isset($this->local_global['public'][$table])) $this->local_global['public'][$table]=$data; //最后数据更新时间 $con->tag_data_time=time();