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' ]));