mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
started logging heartbeats
This commit is contained in:
1 parent
af3b0f9932
commit
aa60215f96
1 file changed
+9
@@ -861,6 +861,15 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
|
||||
|
||||
switch ($message['type']) {
|
||||
case 'ping':
|
||||
$heartbeatTime = new \DateTimeImmutable();
|
||||
$heartbeatTimeFormatted = $heartbeatTime->format('Y-m-d H:i:s.v');
|
||||
|
||||
Console::log('[Realtime][Heartbeat] '
|
||||
. 'time=' . $heartbeatTimeFormatted
|
||||
. ' connectionId=' . $connection
|
||||
. ' projectId=' . ($projectId ?? 'unknown')
|
||||
);
|
||||
|
||||
$server->send([$connection], json_encode([
|
||||
'type' => 'pong'
|
||||
]));
|
||||
|
||||
Reference in new issue
Block a user