From 824e51c6508fe0e5905b143ef6d8dd161b1acbfe Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:59:14 -0400 Subject: [PATCH] fix(API): remove HTTP client timeout (#464) The HTTP client makes requests using the operational context passed from Terraform. The client will no longer enforce its own fixed timeout but will rely on context cancellation instead. --- proxmox/api/client.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/proxmox/api/client.go b/proxmox/api/client.go index 8b268c4f..01e3d560 100644 --- a/proxmox/api/client.go +++ b/proxmox/api/client.go @@ -17,7 +17,6 @@ import ( "net/http" "net/url" "strings" - "time" "github.com/google/go-querystring/query" "github.com/hashicorp/terraform-plugin-log/tflog" @@ -30,9 +29,7 @@ import ( var ErrNoDataObjectInResponse = errors.New("the server did not include a data object in the response") const ( - // the large timeout is to allow for large file uploads. - httpClientTimeout = 5 * time.Minute - basePathJSONAPI = "api2/json" + basePathJSONAPI = "api2/json" ) // Client is an interface for performing requests against the Proxmox API. @@ -93,7 +90,6 @@ func NewConnection(endpoint string, insecure bool) (*Connection, error) { endpoint: strings.TrimRight(u.String(), "/"), httpClient: &http.Client{ Transport: transport, - Timeout: httpClientTimeout, }, }, nil }