optimize 1m starttime logic judgement

This commit is contained in:
blade 2025-10-16 16:00:22 +08:00
parent 2291a45e55
commit beb0991af2
1 changed files with 9 additions and 1 deletions

View File

@ -121,8 +121,16 @@ class MarketDataMain:
if end_time_ts - start_time_ts > 86400000 * 15:
start_time_ts = end_time_ts - 86400000 * 15
start = timestamp_to_datetime(start_time_ts)
elif isinstance(start, int):
if end_time_ts - start > 86400000 * 15:
start_time_ts = end_time_ts - 86400000 * 15
start = start_time_ts
else:
start_time_ts = transform_date_time_to_timestamp(start)
start_time_ts = start
start = timestamp_to_datetime(start_time_ts)
else:
logger.error(f"开始时间格式错误: {start}")
return None
else:
start_time_ts = transform_date_time_to_timestamp(start)
if start_time_ts is None: