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:
parent
2e34c57f6c
commit
a6c6b98d44
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user