← back to Cncp Failure Collector

ecosystem.config.js

26 lines

// Hardened for restart storms — autorestart, min-uptime gate, capped restarts,
// exponential backoff. If 10 rapid restarts happen we stop trying (not into infinity).
module.exports = {
  apps: [{
    name: 'cncp-failure-collector',
    script: 'index.js',
    cwd: __dirname,
    instances: 1,
    exec_mode: 'fork',
    autorestart: true,
    watch: false,
    max_restarts: 10,
    min_uptime: '30s',
    restart_delay: 5000,
    exp_backoff_restart_delay: 2000,
    max_memory_restart: '200M',
    env: {
      NODE_ENV: 'production',
      CNCP_URL: 'http://127.0.0.1:3333',
      COLLECTOR_HOST: 'mac2',
      POLL_INTERVAL_MS: '30000',
      CLASSIFIER_ENABLED: '1'
    }
  }]
};