add maintenance mode
Some checks failed
CI / test-build (push) Failing after 2m12s

This commit is contained in:
2025-12-15 01:11:51 +07:00
parent 507961716e
commit 9779b30a65
7 changed files with 689 additions and 22 deletions

View File

@@ -198,6 +198,16 @@ func (a *App) handleHealthCheck(w http.ResponseWriter, r *http.Request) {
health.Checks["iscsi"] = "healthy"
}
// Check maintenance mode
if a.maintenanceService != nil && a.maintenanceService.IsEnabled() {
health.Checks["maintenance"] = "enabled"
if health.Status == "healthy" {
health.Status = "maintenance"
}
} else {
health.Checks["maintenance"] = "disabled"
}
// Set HTTP status based on health
statusCode := http.StatusOK
if health.Status == "unhealthy" {