From f8d0d7e16084dc43772c1090de314a2badfcc781 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 11:20:38 +0000 Subject: [PATCH] Fix missing timeout in Discord health check Replaced the usage of the global `http.Get` in `internal/discord/health.go` with the pre-configured `http.Client` instance from the bot's API client. This ensures that the HTTP request has an explicit timeout, preventing silent hangs if the API server becomes unresponsive. Co-authored-by: osse101 <4764184+osse101@users.noreply.github.com> --- internal/discord/health.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/discord/health.go b/internal/discord/health.go index e15a0f6a..75adc968 100644 --- a/internal/discord/health.go +++ b/internal/discord/health.go @@ -36,7 +36,7 @@ func (h *HTTPServer) HandleHealth(w http.ResponseWriter, r *http.Request) { // Quick ping to check API apiReachable := false if h.bot.Client != nil { - resp, err := http.Get(h.bot.Client.BaseURL + "/healthz") + resp, err := h.bot.Client.Client.Get(h.bot.Client.BaseURL + "/healthz") if err == nil { apiReachable = resp.StatusCode == http.StatusOK resp.Body.Close()