ProblemThe settlement worker is a single process; an unhandled rejection or crash takes all settlement jobs down until restarted manually.
- No supervisor/restart.
- Unhandled rejections not caught at top level.
- Jobs stuck while process is down.
Solution
- Add top-level error handling and process supervision (or run under PM2/systemd).
- Ensure BullMQ jobs are retried after restart.
- Test crash-recovery.
Acceptance Criteria
- Process restarts automatically after crash.
- Jobs resume.
pnpm --filter settlement-engine build passes.
Note for Contributors: Write a clear PR description. Show a crash-restart-recovery test.
ProblemThe settlement worker is a single process; an unhandled rejection or crash takes all settlement jobs down until restarted manually.
Solution
Acceptance Criteria
pnpm --filter settlement-engine buildpasses.Note for Contributors: Write a clear PR description. Show a crash-restart-recovery test.