From 2d50820932602dd3362b2202f6d5af19914e9b66 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Sat, 22 Feb 2025 11:23:59 -0800 Subject: [PATCH] fix: uses request context instead of timeout for actions (#3663) --- internal/web/actions.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/web/actions.go b/internal/web/actions.go index 4f550a92..df417f32 100644 --- a/internal/web/actions.go +++ b/internal/web/actions.go @@ -1,9 +1,7 @@ package web import ( - "context" "net/http" - "time" "github.com/amir20/dozzle/internal/auth" "github.com/amir20/dozzle/internal/container" @@ -37,9 +35,7 @@ func (h *handler) containerActions(w http.ResponseWriter, r *http.Request) { return } - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) - defer cancel() - if err := containerService.Action(ctx, parsedAction); err != nil { + if err := containerService.Action(r.Context(), parsedAction); err != nil { log.Error().Err(err).Msg("error while trying to perform container action") http.Error(w, err.Error(), http.StatusInternalServerError) return