fix(server): refine error handling and PM2 connection logic
Deploy to Raspberry Pi / deploy (push) Canceled after 1m16s
Deploy to Raspberry Pi / deploy (push) Canceled after 1m16s
- Reduced the maximum restarts for PM2 processes from 20 to 8 and added a restart delay of 2000ms for better stability. - Improved error handling during server startup and PM2 connection, ensuring clearer logging and graceful exits on failure. - Introduced a utility function to filter out PM2 metadata from environment variables, preventing conflicts during process management.
This commit is contained in:
@@ -48,7 +48,8 @@ module.exports = {
|
||||
instances: 1,
|
||||
exec_mode: "fork",
|
||||
autorestart: true,
|
||||
max_restarts: 20,
|
||||
max_restarts: 8,
|
||||
restart_delay: 2000,
|
||||
env: {
|
||||
...env,
|
||||
JFLOW_CONTROL_PORT: env.JFLOW_CONTROL_PORT ?? "8600",
|
||||
|
||||
Reference in New Issue
Block a user