/** * PM2 守护 onchain_scout_gate(Gate USDT 永续行情扫描) * * 在项目根目录: * pm2 start deploy/ecosystem.config.cjs * pm2 logs onchain-scout * * 监听地址与端口来自 config.yaml → app.host / app.port(python -m app.main 内 uvicorn)。 */ const path = require("path"); const ROOT = path.resolve(__dirname, ".."); const isWin = process.platform === "win32"; const py = path.join(ROOT, isWin ? path.join(".venv", "Scripts", "python.exe") : path.join(".venv", "bin", "python")); module.exports = { apps: [ { name: "onchain-scout", cwd: ROOT, script: py, args: ["-m", "app.main"], interpreter: "none", autorestart: true, watch: false, max_restarts: 15, min_uptime: "10s", exp_backoff_restart_delay: 2000, error_file: path.join(ROOT, "runtime", "pm2-error.log"), out_file: path.join(ROOT, "runtime", "pm2-out.log"), merge_logs: true, time: true, env: { PYTHONUNBUFFERED: "1", // 本地导航 iframe 嵌入(勿写进 config.yaml,须在此或 pm2 ecosystem) // NAV_ALLOW_EMBED: "true", // NAV_EMBED_ORIGINS: "http://192.168.8.6:5070", }, }, ], };