fix(monitoring): restore Cloud in-flight snapshots and collapsed dock

This commit is contained in:
RockChinQ
2026-10-15 16:42:24 +08:00
parent bf5dc67d1c
commit 338b856eec
5 changed files with 89 additions and 2 deletions
@@ -1691,9 +1691,14 @@ class MonitoringService(ExecutionDetailsMixin):
workspace = require_workspace_uuid(context)
active = await self.get_executions(context, statuses=['running', 'queued'], limit=100, include_summary=False)
# Execution timestamps are stored as UTC without a timezone. asyncpg
# rejects aware datetimes for these columns, even though SQLite accepts them.
recent_start = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) - datetime.timedelta(
seconds=30
)
recent = await self.get_executions(
context,
start_time=datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(seconds=30),
start_time=recent_start,
limit=100,
include_summary=False,
)
+6
View File
@@ -7,9 +7,13 @@ No payloads or subscriptions survive the final viewer disconnecting.
import asyncio
import contextlib
import logging
import time
logger = logging.getLogger(__name__)
class InflightHub:
def __init__(self):
self.channels = {}
@@ -75,6 +79,8 @@ class InflightHub:
snapshot = await loader()
frame = {'kind': 'snapshot', 'data': snapshot}
except Exception:
if previous is None or previous['kind'] != 'unavailable':
logger.exception('Failed to load in-flight monitoring snapshot')
frame = {'kind': 'unavailable'}
# Heartbeats are sent separately; unchanged snapshots generate no traffic.
if frame != previous: