修复期权开平仓时间按 UTC 入库导致复盘K线标记偏8小时:统一业务时区并一次性迁移。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -715,6 +715,9 @@ def ensure_local_review_synced(
|
||||
backfill_exchange_pnl: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
"""列表/统计前轻量刷新本地源;有交易所时先用历史仓位盈亏覆盖本地再导入复盘."""
|
||||
from lib.options.options_time_lib import migrate_options_utc_wall_clock_to_app
|
||||
|
||||
ts_migrate = migrate_options_utc_wall_clock_to_app(conn)
|
||||
if backfill_exchange_pnl and ex is not None:
|
||||
try:
|
||||
from lib.exchange.okx_options_lib import fetch_all_option_positions_history
|
||||
@@ -735,6 +738,7 @@ def ensure_local_review_synced(
|
||||
out["repaired_usdt"] = repair_coin_review_rows_to_usdt(conn, ex=ex)
|
||||
except Exception:
|
||||
out["repaired_usdt"] = 0
|
||||
out["ts_migrate"] = ts_migrate
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user