blackout: simplify recovery session_id binding to queued value
This commit is contained in:
@@ -1115,7 +1115,6 @@ async def process_blackout_recovery_orders(
|
||||
|
||||
accepted = result.get("rt_cd", "0") == "0"
|
||||
if accepted:
|
||||
runtime_session_id = get_session_info(market).session_id
|
||||
log_trade(
|
||||
conn=db_conn,
|
||||
stock_code=intent.stock_code,
|
||||
@@ -1127,7 +1126,7 @@ async def process_blackout_recovery_orders(
|
||||
pnl=0.0,
|
||||
market=market.code,
|
||||
exchange_code=market.exchange_code,
|
||||
session_id=runtime_session_id,
|
||||
session_id=intent.session_id,
|
||||
)
|
||||
logger.info(
|
||||
"Recovered queued order executed: %s %s (%s) qty=%d price=%.4f source=%s",
|
||||
|
||||
@@ -6525,6 +6525,7 @@ async def test_process_blackout_recovery_executes_valid_intents() -> None:
|
||||
intent.quantity = 1
|
||||
intent.price = 100.0
|
||||
intent.source = "test"
|
||||
intent.session_id = "NXT_AFTER"
|
||||
intent.attempts = 0
|
||||
|
||||
blackout_manager = MagicMock()
|
||||
@@ -6555,7 +6556,7 @@ async def test_process_blackout_recovery_executes_valid_intents() -> None:
|
||||
assert row is not None
|
||||
assert row[0] == "BUY"
|
||||
assert row[1] == 1
|
||||
assert row[2] == "KRX_REG"
|
||||
assert row[2] == "NXT_AFTER"
|
||||
assert row[3].startswith("[blackout-recovery]")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user