From 4f1d8973477b2fd88b8f88850daa296ea137808a Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Fri, 2 Oct 2026 15:52:22 +0000 Subject: [PATCH] fix(cloud): retry workspace snapshots every five minutes instead of daily --- src/langbot/pkg/telemetry/heartbeat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/langbot/pkg/telemetry/heartbeat.py b/src/langbot/pkg/telemetry/heartbeat.py index 74718412d..2499c7e06 100644 --- a/src/langbot/pkg/telemetry/heartbeat.py +++ b/src/langbot/pkg/telemetry/heartbeat.py @@ -271,4 +271,8 @@ async def heartbeat_loop(ap: core_app.Application) -> None: ap.logger.debug(f'Telemetry heartbeat failed: {e}') except Exception: pass - await asyncio.sleep(HEARTBEAT_INTERVAL_SECONDS) + # Cloud dashboards need fresh scoped snapshots, including Workspaces + # discovered after startup. A transient startup/projection failure must + # not suppress synchronization for an entire day. + cloud_runtime = getattr(getattr(ap.persistence_mgr, 'mode', None), 'value', None) == 'cloud_runtime' + await asyncio.sleep(300 if cloud_runtime else HEARTBEAT_INTERVAL_SECONDS)