pm2: add crash-loop governor to all apps; lower srebot max_memory_restart to 12000M

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
deploy
2026-06-29 12:58:56 +00:00
parent a5abecb918
commit fa203c653b
+10
View File
@@ -10,11 +10,21 @@ const DEPLOY_PATH = __dirname;
// SHARED/requirements.txt (both bots also share BOTS/SHARED for code). // SHARED/requirements.txt (both bots also share BOTS/SHARED for code).
const PY_INTERPRETER = `${DEPLOY_PATH}/../SHARED/.venv/bin/python`; const PY_INTERPRETER = `${DEPLOY_PATH}/../SHARED/.venv/bin/python`;
// Crash-loop governor: after max_restarts attempts that each fail to stay up
// min_uptime ms, PM2 marks the app `errored` and stops relaunching it, instead
// of restarting forever and pegging the CPU. See SREBOT/ecosystem.config.js.
const RESTART_POLICY = {
max_restarts: 10,
min_uptime: 10000,
exp_backoff_restart_delay: 200,
};
module.exports = { module.exports = {
apps: [ apps: [
// Discord Bot // Discord Bot
{ {
name: 'tssbot', name: 'tssbot',
...RESTART_POLICY,
script: 'start_bot.py', script: 'start_bot.py',
interpreter: PY_INTERPRETER, interpreter: PY_INTERPRETER,
cwd: DEPLOY_PATH, cwd: DEPLOY_PATH,