-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add max_retries option #57
Conversation
It should make installations more reliable when a network connection is not stable enough. By default it is going to retry downloads three times before giving up.
@josevalim would you mind to take a look? 💜 |
Co-authored-by: José Valim <[email protected]>
@josevalim @wojtekmach thank you, guys! 💜 |
|
||
defp with_retry(fun, attempts) when attempts in 0..15 do | ||
task = Task.async(fun) | ||
first_try = Task.await(task, :infinity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're doing async/await right away. If you don't use Task for the timeout, is it useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was being lazy, but yeah, it's not useful 😅
Fixed in d6a323e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's one more similar place :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG 😓
94b2b75
Thank you!
It should make installations more reliable when a network connection is not stable enough.
By default it is going to retry downloads three times before giving up.