started logging heartbeats

This commit is contained in:
ArnabChatterjee20k committed 2026-02-06 16:58:34 +05:30
1 parent af3b0f9932
commit aa60215f96
1 file changed
+9
+9
View File
@@ -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'
]));