e4aeb0d59f
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
605 B
JavaScript
26 lines
605 B
JavaScript
// 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.
|
|
const RESTART_POLICY = {
|
|
max_restarts: 10,
|
|
min_uptime: 10000,
|
|
exp_backoff_restart_delay: 200,
|
|
};
|
|
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'linkweb',
|
|
...RESTART_POLICY,
|
|
cwd: __dirname,
|
|
script: 'server.js',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: '3020',
|
|
PM2_APP_NAME: 'linkweb',
|
|
WEBHOOK_PATH: '/webhook/github',
|
|
},
|
|
},
|
|
],
|
|
};
|