mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #9055 from appwrite/PLA-1990
fix(realtime): decrement connectionCounter only if connection is known
This commit is contained in:
commit
9a693ecfb5
1 changed files with 1 additions and 2 deletions
|
|
@ -678,11 +678,10 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
|
|||
$server->onClose(function (int $connection) use ($realtime, $stats, $register) {
|
||||
if (array_key_exists($connection, $realtime->connections)) {
|
||||
$stats->decr($realtime->connections[$connection]['projectId'], 'connectionsTotal');
|
||||
$register->get('telemetry.connectionCounter')->add(-1);
|
||||
}
|
||||
$realtime->unsubscribe($connection);
|
||||
|
||||
$register->get('telemetry.connectionCounter')->add(-1);
|
||||
|
||||
Console::info('Connection close: ' . $connection);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue