feat: add checks and limits for 4 grade

This commit is contained in:
TAskMAster339
2026-10-10 14:13:32 +03:00
parent 771951cad7
commit 6892af8842
8 changed files with 402 additions and 1 deletions
+2 -1
View File
@@ -119,7 +119,8 @@ func readyHandler(health *services.HealthService) http.HandlerFunc {
writeError(w, 405, "method_not_allowed", "method not allowed", requestID)
return
}
ctx, cancel := context.WithTimeout(r.Context(), 2*time.Second)
// Readiness must finish before HAProxy's one-second check read timeout.
ctx, cancel := context.WithTimeout(r.Context(), 500*time.Millisecond)
defer cancel()
if err := health.Ready(ctx); err != nil {
writeError(w, 503, "unavailable", "dependency unavailable", requestID)