fix: replace hardcoded 192.168.1.122 with node122 (hostname resolves via /etc/hosts to LAN or EasyTier)

- mo_config.py: xiaoguo_host=node122, xiaoguo_api_url property
- market_screener.py, xiaoguo_scanner.py, xiaoguo_news_processor.py: use mo_config or node122 fallback
- scripts/intraday_health_check.py, scripts/ocr_client.py: node122
- EasyTier connects at 10.144.144.2 when off-LAN
This commit is contained in:
hmo
2026-06-30 02:27:52 +08:00
parent efaa20d775
commit f4b2467ae9
7 changed files with 39 additions and 8 deletions
+9 -2
View File
@@ -17,7 +17,14 @@ except ImportError:
DATA_DIR = Path(__file__).parent / "data"
DB_PATH = DATA_DIR / "mofin.db"
XIAOGUO_API = "http://192.168.1.122:18003/v1/chat/completions"
XIAOGUO_API = "http://node122:18003/v1/chat/completions" # fallback, /etc/hosts resolves to LAN or EasyTier
def _get_xiaoguo_url():
try:
from mo_config import get_config
return get_config().xiaoguo_api_url
except Exception:
return XIAOGUO_API
XIAOGUO_MODEL = "Qwen3.6-27B-MTPLX-Optimized-Speed"
SCAN_INTERVAL = 3600 # 同一只股1小时内不重复搜
MAX_STOCKS_PER_RUN = 15
@@ -221,7 +228,7 @@ def check_stock(code, name, articles):
}).encode()
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
req = urllib.request.Request(XIAOGUO_API, data=payload,
req = urllib.request.Request(_get_xiaoguo_url(), data=payload,
headers={"Content-Type": "application/json"}, method="POST")
try:
resp = opener.open(req, timeout=30)