fix: add a default requests deadline when deadline is 0 (#19287)

This commit is contained in:
Harshavardhana 2024-03-18 12:30:41 -07:00 committed by GitHub
parent f168ef9989
commit 741de4cf94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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