fix: mofin_collect 9:30前跳过板块采集
This commit is contained in:
+17
-8
@@ -2,21 +2,30 @@
|
||||
"""mofin_collect.py — MoFin 数据采集链
|
||||
|
||||
每轮盯盘 cron 前运行,顺序执行:
|
||||
1. market_watch — 拉90个行业板块数据
|
||||
2. trend_detector — 检测17种信号
|
||||
3. xiaoguo_news_processor — 搜新闻+小果分析
|
||||
1. market_watch — 拉90个行业板块数据(9:30前跳过,市场未开)
|
||||
2. trend_detector — 检测17种信号(依赖板块数据,同跳)
|
||||
3. mofin_news — 搜新闻+小果分析
|
||||
"""
|
||||
|
||||
import subprocess, sys, time
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
BASE = Path(__file__).parent.parent if "hermes" in str(Path(__file__).resolve()) else Path(__file__).parent
|
||||
|
||||
SCRIPTS = [
|
||||
("market_watch.py", 60),
|
||||
("trend_detector.py", 10),
|
||||
("mofin_news.py", 50),
|
||||
]
|
||||
now = datetime.now()
|
||||
market_open = (now.hour >= 9 and now.minute >= 30) or now.hour >= 10
|
||||
# 9:30前不跑市场数据采集(同花顺页面无数据)
|
||||
# 但仍然跑新闻采集(不依赖市场是否开盘)
|
||||
|
||||
SCRIPTS = []
|
||||
if market_open:
|
||||
SCRIPTS.append(("market_watch.py", 60))
|
||||
SCRIPTS.append(("trend_detector.py", 60))
|
||||
else:
|
||||
print(f"[{now.strftime('%H:%M')}] 市场未开盘(9:30),跳过板块采集", flush=True)
|
||||
|
||||
SCRIPTS.append(("mofin_news.py", 50))
|
||||
|
||||
for script, timeout in SCRIPTS:
|
||||
path = BASE / script
|
||||
|
||||
Reference in New Issue
Block a user