mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: correct presence usage decrement in triggerPresenceUsage calls
This commit is contained in:
+2
-2
@@ -608,7 +608,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
|
||||
Query::equal('hostname', [$hostname]),
|
||||
Query::equal('source', ['realtime']),
|
||||
]);
|
||||
triggerPresenceUsage($deletionCount, $project);
|
||||
triggerPresenceUsage(-$deletionCount, $project);
|
||||
} catch (Throwable $th) {
|
||||
Console::error("Realtime startup orphan sweep failed for project {$project->getId()}: {$th->getMessage()}");
|
||||
logError($th, 'realtimeOrphanPresenceCleanup', tags: [
|
||||
@@ -1370,7 +1370,7 @@ $server->onClose(function (int $connection) use ($realtime, $stats, $register) {
|
||||
|
||||
try {
|
||||
$deletionCount = $dbForProject->deleteDocuments('presenceLogs', [Query::equal('$id', $presenceIds)]);
|
||||
triggerPresenceUsage($deletionCount, $project);
|
||||
triggerPresenceUsage(-$deletionCount, $project);
|
||||
} catch (Throwable $th) {
|
||||
Span::error($th);
|
||||
logError($th, 'realtimeOnClosePresenceDeletion', tags: [
|
||||
|
||||
@@ -87,7 +87,6 @@ class Presence extends Any
|
||||
'default' => null,
|
||||
'example' => self::TYPE_DATETIME_EXAMPLE,
|
||||
]);
|
||||
// `hostname` is intentionally not exposed.
|
||||
// User-defined extras flow through Any's generic mapping, surfaced under
|
||||
// the "metadata" key declared via setAdditionalPropertiesKey() above.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user