fix: use ServerService::getServer() for node lookup in WebSocket

This commit is contained in:
xboard
2026-03-26 03:51:58 +08:00
parent 74b5ef0b27
commit 3c3639613e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ class ServerService
* @param string $serverType * @param string $serverType
* @return Server|null * @return Server|null
*/ */
public static function getServer($serverId, ?string $serverType) public static function getServer($serverId, ?string $serverType = null): Server | null
{ {
return Server::query() return Server::query()
->when($serverType, function ($query) use ($serverType) { ->when($serverType, function ($query) use ($serverType) {
+1 -1
View File
@@ -131,7 +131,7 @@ class NodeWorker
return; return;
} }
$node = Server::find($nodeId); $node = ServerService::getServer($nodeId, null);
if (!$node) { if (!$node) {
$conn->close(json_encode([ $conn->close(json_encode([
'event' => 'error', 'event' => 'error',