From 741de4cf94755fc11ed213d9c0f4a7f49522ee9e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 18 Mar 2024 12:30:41 -0700 Subject: [PATCH] fix: add a default requests deadline when deadline is 0 (#19287) --- cmd/handler-api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/handler-api.go b/cmd/handler-api.go index 0cc55c556..e015ca143 100644 --- a/cmd/handler-api.go +++ b/cmd/handler-api.go @@ -291,7 +291,11 @@ func (t *apiConfig) getRequestsPool() (chan struct{}, time.Duration) { defer t.mu.RUnlock() if t.requestsPool == nil { - return nil, time.Duration(0) + return nil, 10 * time.Second + } + + if t.requestsDeadline <= 0 { + return t.requestsPool, 10 * time.Second } return t.requestsPool, t.requestsDeadline