数据同步页增加持仓天数展示,修复持仓同步无法拉取历史数据的问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -113,13 +113,7 @@ def sync_positions_bg(contract_code: str) -> bool:
|
||||
.filter(DailyBar.contract == code)
|
||||
.order_by(DailyBar.date).all()
|
||||
]
|
||||
# Only sync dates within or after existing position date range;
|
||||
# akshare may not have data for very old dates
|
||||
if existing_dates:
|
||||
min_pos = min(existing_dates)
|
||||
missing = [d for d in bar_dates if d not in existing_dates and d >= min_pos]
|
||||
else:
|
||||
missing = [d for d in bar_dates if d not in existing_dates]
|
||||
missing = [d for d in bar_dates if d not in existing_dates]
|
||||
total_missing = len(missing)
|
||||
|
||||
with _lock:
|
||||
|
||||
Reference in New Issue
Block a user