feat: refactor health check endpoint with real-time worker status

Extract health check logic into GetHealth method on Config struct and
integrate with Worker service for accurate scan status reporting.

Changes:
- Move health check handler from inline function to Config.GetHealth()
- Add Worker field to Config struct for dependency injection
- Wire Worker into main server dependencies
- Report actual scan_in_progress status using Worker.HasActiveScans()
- Report actual active_jobs count using Worker.GetActiveJobCount()

This provides more accurate health monitoring by checking the real state
of background jobs rather than returning static placeholder values.
This commit is contained in:
2026-03-05 20:26:42 -05:00
parent e8efc2ee3e
commit d740442ca4
3 changed files with 24 additions and 20 deletions
+1
View File
@@ -52,6 +52,7 @@ type Config struct {
AnalyticsHandler *handlers.AnalyticsHandler
QueueHandler *handlers.QueueHandler
CollectionHandler *handlers.CollectionHandler
Worker *services.Worker
DashboardHandler *handlers.DashboardHandler
DashboardService *services.DashboardService
OPDSHandler *handlers.OPDSHandler