fix: preserve source failures in last fetch

This commit is contained in:
2026-08-08 07:54:09 +08:00
parent af90ea21a4
commit 6403d2f511
+7 -1
View File
@@ -1997,7 +1997,13 @@ def account_pricing_fetch_label(
fetched = short_time(account.get("pricing_last_fetch_at"))
status = str(account.get("pricing_fetch_status") or "").strip()
if fetched == "-":
return str(pricing_source.get("updated") or "-") if pricing_source else (status or "-")
if not pricing_source:
return status or "-"
updated = str(pricing_source.get("updated") or "-")
source_status = str(pricing_source.get("status") or "").strip()
if source_status not in {"", "healthy"}:
return f"{updated} {source_status}" if updated != "-" else source_status
return updated
if status in {"", "matched", "ok"}:
return fetched
return f"{fetched} {status}"