feat(cloud): report planner transport status
This commit is contained in:
@@ -266,6 +266,7 @@ class SQLAlchemyCloudRepository:
|
||||
*,
|
||||
address: str | None,
|
||||
last_seen_at: datetime,
|
||||
planner_transport: str = "direct",
|
||||
) -> None:
|
||||
with self._sessions.begin() as session:
|
||||
row = session.get(HostRow, host_id)
|
||||
@@ -275,12 +276,14 @@ class SQLAlchemyCloudRepository:
|
||||
host_id=host_id,
|
||||
address=address,
|
||||
last_seen_at=_iso(last_seen_at),
|
||||
planner_transport=planner_transport,
|
||||
)
|
||||
)
|
||||
return
|
||||
if address is not None:
|
||||
row.address = address
|
||||
row.last_seen_at = _iso(last_seen_at)
|
||||
row.planner_transport = planner_transport
|
||||
|
||||
def replace_host_devices(
|
||||
self,
|
||||
@@ -1419,6 +1422,9 @@ def _host_from_row(row: HostRow) -> Any:
|
||||
host_id=row.host_id,
|
||||
address=row.address,
|
||||
last_seen_at=_parse_dt(row.last_seen_at) or utc_now(),
|
||||
planner_transport=(
|
||||
row.planner_transport if row.planner_transport in {"direct", "cloud"} else "direct"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user