Files
qihuo/ecosystem.config.cjs
dekun e5a586f903 Restructure into modules/ with single-process CTP and config/ layout.
Move business code under modules/, env template to config/, PM2 single qihuo process, and _legacy shims for old imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 14:42:16 +08:00

37 lines
950 B
JavaScript

const path = require("path");
const fs = require("fs");
const ROOT = __dirname;
const venvCandidates = [
path.join(ROOT, "venv", "bin", "python"),
path.join(ROOT, "venv", "Scripts", "python.exe"),
];
const interpreter = venvCandidates.find((p) => fs.existsSync(p)) || "python3";
module.exports = {
apps: [
{
name: "qihuo",
script: "app.py",
cwd: ROOT,
interpreter,
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: "8192M",
env: {
NODE_ENV: "production",
PYTHONPATH: path.join(ROOT, "_legacy"),
LANG: "zh_CN.UTF-8",
LC_ALL: "zh_CN.UTF-8",
LC_CTYPE: "zh_CN.UTF-8",
QIHUO_STARTUP_WORKERS: "8",
QIHUO_MEMORY_MB: "8192",
},
error_file: path.join(ROOT, "logs", "pm2-error.log"),
out_file: path.join(ROOT, "logs", "pm2-out.log"),
time: true,
},
],
};