feat: 失败二轮重试(休息60s后失败股整体重跑) + sync脚本补7个分叉副本硬链
This commit is contained in:
@@ -510,6 +510,7 @@ def main():
|
||||
ok = 0
|
||||
fail = 0
|
||||
skip = 0
|
||||
failed_codes = []
|
||||
for i, code in enumerate(codes):
|
||||
if has_llm_analysis(code) and not analysis_stale(code, force_today):
|
||||
print(f" [{i+1}/{len(codes)}] \u23ed {code} 已有12维分析且未过期")
|
||||
@@ -521,12 +522,30 @@ def main():
|
||||
ok += 1
|
||||
else:
|
||||
fail += 1
|
||||
failed_codes.append(code)
|
||||
|
||||
# 间隔8秒(pro model较重但gateway可承受;retry逻辑吸收瞬断)
|
||||
if i < len(codes) - 1:
|
||||
print(f" 等待8秒...", flush=True)
|
||||
time.sleep(8)
|
||||
|
||||
# ── 失败二轮:主跑结束后休息 60s 让上游恢复,失败股整体重试一次 ──
|
||||
# (凌晨上游空输出高发,二轮可救回大半;仍失败的留给下一轮调度)
|
||||
if failed_codes:
|
||||
print(f"\n{'='*50}")
|
||||
print(f"失败二轮: {len(failed_codes)}只,休息60s后重试...")
|
||||
time.sleep(60)
|
||||
retry_ok = 0
|
||||
for code in failed_codes:
|
||||
print(f" [retry] {code} ", end="", flush=True)
|
||||
if process_stock(code, force_today):
|
||||
retry_ok += 1
|
||||
ok += 1
|
||||
fail -= 1
|
||||
print(f" 等待8秒...", flush=True)
|
||||
time.sleep(8)
|
||||
print(f"失败二轮: {retry_ok}/{len(failed_codes)} 救回")
|
||||
|
||||
print(f"\n{'='*50}")
|
||||
print(f"完成: {ok}成功, {fail}失败, {skip}跳过")
|
||||
print(f"{'='*50}")
|
||||
|
||||
Reference in New Issue
Block a user