fix: 小果LLM不可达降级处理

- xiaoguo_scanner.py: LLM超时/不可达→标记unknown继续扫,不跳过
- intraday_health_check.py: 小果无数据时不报严重错误(可能是正常离线)
- scanner profile目录同步
This commit is contained in:
知微
2026-06-24 22:04:18 +08:00
parent d27dbcc6ad
commit 9b878001af
2 changed files with 13 additions and 12 deletions
+5 -3
View File
@@ -224,15 +224,17 @@ def check_stock(code, name, articles):
req = urllib.request.Request(XIAOGUO_API, data=payload,
headers={"Content-Type": "application/json"}, method="POST")
try:
resp = opener.open(req, timeout=30)
resp = opener.open(req, timeout=15)
reply = json.loads(resp.read())["choices"][0]["message"]["content"]
if "有关" in reply or "利好" in reply or "利空" in reply:
for s in ["利好", "利空", "中性"]:
if s in reply:
return True, s
return True, "中性"
except:
pass
except Exception as e:
# LLM不可达 → 降级:标记为unknown,不阻塞扫描流程
print(f" ⚠️ 小果LLM不可达({str(e)[:30]}),降级为unknown", flush=True)
return True, "unknown"
return None, None