Skip to content

Commit 2dcedcd

Browse files
committed
fix: versionSwitchPaths — PM2 max-memory-restart 按版本区分(mtcute=768M, teleproto=512M)
1 parent 767d490 commit 2dcedcd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/utils/versionSwitchPaths.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,9 @@ export function pm2StartEdition(
11791179
}
11801180
// Also drop mis-pointed "telebox" if starting mtcute from old flat cwd, etc.
11811181
const command = "exec node scripts/run-tsx.cjs ./src/index.ts";
1182+
// mtcute: heap=512MB + RSS threshold=768MB → PM2 restart at 768M
1183+
// teleproto: heap=192MB + RSS threshold=512MB → PM2 restart at 512M
1184+
const maxMemRestart = version === "mtcute" ? "768M" : "512M";
11821185
runPm2(
11831186
[
11841187
"start",
@@ -1189,7 +1192,7 @@ export function pm2StartEdition(
11891192
repoRoot,
11901193
"--time",
11911194
"--max-memory-restart",
1192-
"512M",
1195+
maxMemRestart,
11931196
"--restart-delay",
11941197
"5000",
11951198
"--",

0 commit comments

Comments
 (0)