mirror of
https://github.com/selfhosters-cc/container-census.git
synced 2026-05-21 06:49:06 -05:00
fc0170f85e
Changed POST /api/hosts/{id}/scan from async (202 Accepted) to
synchronous (200 OK). The endpoint now waits for the scan to complete
and saves all data before responding to the client.
Benefits:
- Frontend gets fresh data immediately after scan completes
- No race conditions between scan completion and loadData()
- No need for artificial delays in frontend
- Proper error handling if scan fails
The scan runs in the request context and responds with:
- 200 OK on success with container count
- 500 Internal Server Error if scan fails
- Validates host exists and is enabled before scanning
This ensures the UI always shows the correct container state after
start/stop/restart/remove operations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>