risk: polish retry coverage and refresh failure summary
This commit is contained in:
10
src/main.py
10
src/main.py
@@ -1375,7 +1375,10 @@ async def _cancel_pending_orders_for_kill_switch(
|
||||
)
|
||||
|
||||
if failures:
|
||||
raise RuntimeError("; ".join(failures[:3]))
|
||||
summary = "; ".join(failures[:3])
|
||||
if len(failures) > 3:
|
||||
summary = f"{summary} (+{len(failures) - 3} more)"
|
||||
raise RuntimeError(summary)
|
||||
|
||||
|
||||
async def _refresh_order_state_for_kill_switch(
|
||||
@@ -1402,7 +1405,10 @@ async def _refresh_order_state_for_kill_switch(
|
||||
)
|
||||
failures.append(f"{market.code}/{market.exchange_code}: {exc}")
|
||||
if failures:
|
||||
raise RuntimeError("; ".join(failures[:3]))
|
||||
summary = "; ".join(failures[:3])
|
||||
if len(failures) > 3:
|
||||
summary = f"{summary} (+{len(failures) - 3} more)"
|
||||
raise RuntimeError(summary)
|
||||
|
||||
|
||||
def _reduce_risk_for_kill_switch() -> None:
|
||||
|
||||
Reference in New Issue
Block a user