Skip to content

Commit 24a4623

Browse files
authored
Increased request timeout (#110)
1 parent 80f5cfd commit 24a4623

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/provider/managers/session.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"net/http"
66
"os"
77
"strings"
8+
"time"
89

910
"github.com/cloudfoundry/go-cfclient/v3/client"
1011
config "github.com/cloudfoundry/go-cfclient/v3/config"
@@ -34,8 +35,10 @@ func (c *CloudFoundryProviderConfig) NewSession(httpClient *http.Client, req pro
3435
var opts []config.Option
3536
var finalAgent string
3637

37-
cfUserAgent := os.Getenv("CF_APPEND_USER_AGENT")
38+
// Setting a higher value than default of 30s as file uploads seem to fail
39+
opts = append(opts, config.RequestTimeout(10*time.Minute))
3840

41+
cfUserAgent := os.Getenv("CF_APPEND_USER_AGENT")
3942
if len(strings.TrimSpace(cfUserAgent)) == 0 {
4043
finalAgent = fmt.Sprintf("Terraform/%s terraform-provider-cloudfoundry/%s", req.TerraformVersion, version.ProviderVersion)
4144
} else {

0 commit comments

Comments
 (0)