2 parents 7065cef + 532ce76 commit d177bd6Copy full SHA for d177bd6
1 file changed
src/cli.py
@@ -40,9 +40,12 @@ def sync_single_stock_min_data(
40
start_date: 开始日期
41
incremental: 是否启用精确增量
42
"""
43
+ # DB 中 code 为纯 6 位数字(reader 写入时会截取),查询时需匹配
44
+ db_code = code[-6:] if len(code) > 6 else code
45
+
46
# 精确增量:查询该股票的最新日期
47
if incremental and not start_date:
- latest = storage.get_latest_datetime_by_code('minute5_data', code)
48
+ latest = storage.get_latest_datetime_by_code('minute5_data', db_code)
49
if latest:
50
start_date = (latest + timedelta(days=1)).strftime('%Y-%m-%d')
51
logger.debug(f"{code} 增量起始日期: {start_date}")
0 commit comments