This commit is contained in:
jb-2020 2025-10-16 22:06:40 -04:00 committed by GitHub
commit fba8d9b191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"math/rand"
"net/http"
"net/url"
"os"
"strconv"
"sync"
"time"
@ -210,7 +211,17 @@ func NewClient(githubConfigURL string, creds *ActionsAuth, options ...ClientOpti
retryClient.RetryMax = ac.retryMax
retryClient.RetryWaitMax = ac.retryWaitMax
retryClient.HTTPClient.Timeout = 5 * time.Minute // timeout must be > 1m to accomodate long polling
ts, found := os.LookupEnv("ACTIONS_HTTP_CLIENT_TIMEOUT_SECONDS")
if !found {
// Default to 5 minutes
// timeout must be > 1m to accommodate long polling
ts = "300"
}
timeout, err := strconv.ParseInt(ts, 10, 64)
if err != nil {
return nil, fmt.Errorf("failed to convert ACTIONS_HTTP_CLIENT_TIMEOUT_SECONDS to int64: %v", err)
}
retryClient.HTTPClient.Timeout = time.Duration(timeout) * time.Second
transport, ok := retryClient.HTTPClient.Transport.(*http.Transport)
if !ok {