From 768fdfd419040376a0ac9de62a391151bf29ed0c Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Mar 2026 18:31:32 +0100 Subject: [PATCH] Add PM2 restart_delay and max_restarts to prevent crash-loop spam When DB_PASSWORD is missing on startup, server exits and PM2 was restarting every ~660ms flooding backend.log with ER_ACCESS_DENIED_ERROR. Now waits 5s between restarts and caps at 10 attempts. Co-Authored-By: Claude Sonnet 4.6 --- database/pm2.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/database/pm2.config.js b/database/pm2.config.js index 3dbf2ef..f7e9604 100644 --- a/database/pm2.config.js +++ b/database/pm2.config.js @@ -5,6 +5,8 @@ module.exports = { script: './server.js', cwd: __dirname, watch: false, + restart_delay: 5000, + max_restarts: 10, env: { NODE_ENV: 'production', PORT: 5000,