mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-07-02 03:35:43 +00:00
fix: return degraded status for scanner health check failures
- Scanner failures (e.g., GitHub API rate limits) no longer mark server as unhealthy - Server can still serve cached packages when scanners are unavailable - Readiness probes will now pass with degraded scanner status - Prevents unnecessary pod restarts due to external API issues Fixes: Readiness probes failing with 503 due to GHSA rate limiting
This commit is contained in:
+3
-1
@@ -290,7 +290,9 @@ func (a *App) initializeComponents() error {
|
|||||||
a.healthChecker.AddCheck("scanner", func(ctx context.Context) (health.Status, string) {
|
a.healthChecker.AddCheck("scanner", func(ctx context.Context) (health.Status, string) {
|
||||||
if a.config.Security.Enabled {
|
if a.config.Security.Enabled {
|
||||||
if err := a.scanManager.Health(ctx); err != nil {
|
if err := a.scanManager.Health(ctx); err != nil {
|
||||||
return health.StatusUnhealthy, err.Error()
|
// Scanner failures (e.g., API rate limits) shouldn't mark server as unhealthy
|
||||||
|
// Server can still serve cached packages, just can't scan new ones
|
||||||
|
return health.StatusDegraded, err.Error()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return health.StatusHealthy, ""
|
return health.StatusHealthy, ""
|
||||||
|
|||||||
Reference in New Issue
Block a user