1b3a7f1bdc
Preserve trading state when CTP memory is empty, bootstrap equity/positions on page load, stabilize risk status from DB monitors, and remove app-layer manual close cooling periods. Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
901 B
JavaScript
36 lines
901 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",
|
|
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,
|
|
},
|
|
],
|
|
};
|