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

fix(file): upload timeout with 596 response code (#1315)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2024-05-21 19:31:02 -04:00 committed by GitHub
parent 2e34c57f6c
commit a6c6b98d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,15 +49,18 @@ func (c *Client) ListDatastoreFiles(
) ([]*DatastoreFileListResponseData, error) {
resBody := &DatastoreFileListResponseBody{}
err := c.DoRequest(
ctx,
http.MethodGet,
c.ExpandPath("content"),
nil,
resBody,
err := retry.Do(
func() error {
return c.DoRequest(ctx, http.MethodGet, c.ExpandPath("content"), nil, resBody)
},
retry.Context(ctx),
retry.RetryIf(func(err error) bool {
return !errors.Is(err, api.ErrResourceDoesNotExist)
}),
retry.LastErrorOnly(true),
)
if err != nil {
return nil, fmt.Errorf("error retrieving files from datastore %s: %w", c.StorageName, err)
return nil, fmt.Errorf("error listing files from datastore %s: %w", c.StorageName, err)
}
if resBody.Data == nil {