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
@@ -175,6 +175,7 @@ func main() {
DashboardHandler: dashboardHandler,
DashboardService: dashboardService,
OPDSHandler: opdsHandler,
Worker: worker,
SystemSettingsHandler: systemSettingsHandler,
ConnManager: connManager,
QueueProcessor: queueProcessor,