From aa60215f9675150c5d8fe58959057af64a99db80 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 6 Feb 2026 16:58:34 +0530 Subject: [PATCH] started logging heartbeats --- app/realtime.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/realtime.php b/app/realtime.php index 8c34df749e..0a1dde7b96 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -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' ]));