Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use retry when getting file sizes #17

Closed
cuducos opened this issue Nov 17, 2022 · 0 comments
Closed

Use retry when getting file sizes #17

cuducos opened this issue Nov 17, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@cuducos
Copy link
Owner

cuducos commented Nov 17, 2022

Here:

chunk/main.go

Line 222 in a27be85

t, err := d.getDownloadSize(ctx, u) // TODO: retry

We could use retry.Do(…) in a similar way we use on the download:

chunk/main.go

Lines 162 to 173 in a27be85

err := retry.Do(
func() error {
b, err := d.downloadFileWithTimeout(ctx, u)
if err != nil {
return err
}
ch <- b
return nil
},
retry.Attempts(d.MaxRetriesPerChunk),
retry.MaxDelay(d.WaitBetweenRetries),
)

@cuducos cuducos added the good first issue Good for newcomers label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant