Fix position flicker, drop futures cooloff, prioritize startup display.

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>
This commit is contained in:
dekun
2026-06-30 23:17:18 +08:00
parent 2386eca324
commit 1b3a7f1bdc
9 changed files with 218 additions and 153 deletions
+17 -4
View File
@@ -1,21 +1,34 @@
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: "/opt/qihuo",
interpreter: "/opt/qihuo/venv/bin/python",
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: "/opt/qihuo/logs/pm2-error.log",
out_file: "/opt/qihuo/logs/pm2-out.log",
error_file: path.join(ROOT, "logs", "pm2-error.log"),
out_file: path.join(ROOT, "logs", "pm2-out.log"),
time: true,
},
],