Skip to content

Commit d177bd6

Browse files
committed
Merge fix/minute-incremental: 修复分钟线增量 code 格式不匹配
2 parents 7065cef + 532ce76 commit d177bd6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ def sync_single_stock_min_data(
4040
start_date: 开始日期
4141
incremental: 是否启用精确增量
4242
"""
43+
# DB 中 code 为纯 6 位数字(reader 写入时会截取),查询时需匹配
44+
db_code = code[-6:] if len(code) > 6 else code
45+
4346
# 精确增量:查询该股票的最新日期
4447
if incremental and not start_date:
45-
latest = storage.get_latest_datetime_by_code('minute5_data', code)
48+
latest = storage.get_latest_datetime_by_code('minute5_data', db_code)
4649
if latest:
4750
start_date = (latest + timedelta(days=1)).strftime('%Y-%m-%d')
4851
logger.debug(f"{code} 增量起始日期: {start_date}")

0 commit comments

Comments
 (0)