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