0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-03 20:12:59 +00:00

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.
This commit is contained in:
Pavel Boldyrev 2023-08-05 18:59:14 -04:00 committed by GitHub
parent 5a3b1ccaf7
commit 824e51c650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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