Files
2026-05-30 15:55:37 +08:00

42 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* PM2 守护 onchain_scout_gateGate USDT 永续行情扫描)
*
* 在项目根目录:
* pm2 start deploy/ecosystem.config.cjs
* pm2 logs onchain-scout
*
* 监听地址与端口来自 config.yaml → app.host / app.portpython -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",
// NAV_EMBED_SESSION: "1",
},
},
],
};