WIN-2308041133\Administrator hai 1 semana
pai
achega
2a2bf3f0fe

+ 1 - 1
app/services/workerman/chat/ChatHandle.php

@@ -108,7 +108,7 @@ class ChatHandle
 
         // 发送给目标用户
         if (isset($this->service->user()[$to_uid])) {
-            $this->response->connection($this->service->user()[$to_uid])->send('reply', $data);
+            $response->connection($this->service->user()[$to_uid])->send('reply', $data);
         }
     }
 }

+ 1 - 1
app/services/workerman/chat/ChatService.php

@@ -89,7 +89,7 @@ class ChatService
         $this->timer = Timer::add(15, function () use (&$worker) {
             $time_now = time();
             foreach ($worker->connections as $connection) {
-                if ($time_now - $connection->lastMessageTime > 12) {
+                if ($time_now - $connection->lastMessageTime > 60) {
                     $this->response->connection($connection)->close('timeout');
                 }
             }