fix(account-snapshot): treat timeout/http5xx as transient fallback failures
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
084e05a97d
commit
e3142017c9
@@ -217,7 +217,7 @@ class AccountSnapshotService:
|
||||
try:
|
||||
return self._broker.get_balance()
|
||||
except BrokerBalanceError as exc:
|
||||
if exc.code != "transport_failed":
|
||||
if exc.code not in {"transport_failed", "timeout", "http_5xx"}:
|
||||
raise AccountSnapshotUnavailable(
|
||||
"live_read_failed", detail_code=exc.code
|
||||
) from None
|
||||
@@ -253,7 +253,7 @@ class AccountSnapshotService:
|
||||
reserved_cash: float = 0.0,
|
||||
) -> Optional[str]:
|
||||
"""Return a stable rejection reason, or None when bounded admission passes."""
|
||||
if self._last_cash_error not in {None, "transport_failed"}:
|
||||
if self._last_cash_error not in {None, "transport_failed", "timeout", "http_5xx"}:
|
||||
return "account_snapshot_unavailable"
|
||||
try:
|
||||
snapshot = self._load_current()
|
||||
|
||||
Reference in New Issue
Block a user