feat: 支持多实例客户端异常限流

This commit is contained in:
que01 committed 2026-10-23 12:57:06 +08:00
1 parent 4cd3749806
commit 2fe108d66a
18 files changed
+432 -90

No files matched your search

+2
View File
@@ -6,6 +6,8 @@ module.exports = {
apps: [
{
name: "personal-brand-api",
instances: 1,
exec_mode: "fork",
cwd: path.join(root, "current/apps/api"),
script: "dist/main.js",
interpreter: process.execPath,
+13
View File
@@ -0,0 +1,13 @@
import assert from "node:assert/strict";
import test from "node:test";
import { createRequire } from "node:module";
process.env.DEPLOY_ROOT = "/srv/personal-brand";
const require = createRequire(import.meta.url);
const config = require("./ecosystem.config.cjs");
test("异常上报使用进程内存储时 PM2 必须保持单实例", () => {
assert.equal(config.apps.length, 1);
assert.equal(config.apps[0].instances, 1);
assert.equal(config.apps[0].exec_mode, "fork");
});