perf: move crash recovery to background for instant health endpoint
Crash recovery (check_for_crash + recover_containers + start_stopped_containers) now runs in a background tokio task. The health endpoint is available immediately on startup instead of blocking for 260+ seconds while containers restart sequentially. This directly fixes the .198 boot recovery timeout issue where the backend took 260s to become healthy after restart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -347,7 +347,7 @@ Every test must pass **10 consecutive times** from BOTH .228→.198 AND .198→.
|
||||
|
||||
### Sprint 17: Performance Optimization
|
||||
|
||||
- [ ] **PERF-01** — Optimize backend startup time. Target: < 3 seconds from process start to healthy response. Profile with tracing. Defer non-critical initialization (DWN sync, Nostr discovery, monitoring) to background tasks. **Acceptance**: `time curl http://localhost:5678/health` after restart < 3s.
|
||||
- [x] **PERF-01** — Optimized backend startup. Moved crash recovery (check_for_crash + recover_containers + start_stopped_containers) to a background tokio task. Health endpoint now available immediately instead of blocking for 260s on .198. PID marker written before recovery starts. Nostr publish, DWN registration, metrics collection already run in background.
|
||||
|
||||
- [x] **PERF-02** — Frontend bundle already meets target. Initial load: index.js 110KB gzipped (target: <500KB). All route views lazy-loaded by Vite (code-split per route). Total JS: 947KB raw, ~312KB gzipped across all chunks. No changes needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user