fix(health): preserve transient failure codes through stale snapshot fallback
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
4a2e7dd893
commit
9c5a01ed67
@@ -443,9 +443,11 @@ class ExecutionService:
|
||||
try:
|
||||
holdings = self._sell_dispatch_balance_reader()
|
||||
except AccountSnapshotUnavailable as exc:
|
||||
code = "stale_snapshot" if exc.code == "expired" else (
|
||||
getattr(exc, "detail_code", None) or exc.code
|
||||
)
|
||||
detail_code = getattr(exc, "detail_code", None)
|
||||
if exc.code == "expired" and detail_code is None:
|
||||
code = "stale_snapshot"
|
||||
else:
|
||||
code = detail_code or exc.code
|
||||
lifecycle, backoff = self._balance_health.record_failure(
|
||||
self._balance_worker, code=code
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user