risk: add kill-switch refresh retry policy and tests (#377)
This commit is contained in:
@@ -1384,6 +1384,7 @@ async def _refresh_order_state_for_kill_switch(
|
||||
overseas_broker: OverseasBroker,
|
||||
markets: list[MarketInfo],
|
||||
) -> None:
|
||||
failures: list[str] = []
|
||||
seen_overseas: set[str] = set()
|
||||
for market in markets:
|
||||
try:
|
||||
@@ -1399,6 +1400,9 @@ async def _refresh_order_state_for_kill_switch(
|
||||
market.exchange_code,
|
||||
exc,
|
||||
)
|
||||
failures.append(f"{market.code}/{market.exchange_code}: {exc}")
|
||||
if failures:
|
||||
raise RuntimeError("; ".join(failures[:3]))
|
||||
|
||||
|
||||
def _reduce_risk_for_kill_switch() -> None:
|
||||
|
||||
Reference in New Issue
Block a user