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

Add max_retries option #57

Merged
merged 11 commits into from
Jul 6, 2023
Merged

Add max_retries option #57

merged 11 commits into from
Jul 6, 2023

Conversation

philss
Copy link
Owner

@philss philss commented Jun 26, 2023

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.

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.
@philss
Copy link
Owner Author

philss commented Jul 6, 2023

@josevalim would you mind to take a look? 💜

Co-authored-by: José Valim <jose.valim@gmail.com>
lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled.ex Outdated Show resolved Hide resolved
lib/rustler_precompiled/config.ex Outdated Show resolved Hide resolved
@philss philss changed the title Add retry and retry_attempts options Add max_retries option Jul 6, 2023
@philss
Copy link
Owner Author

philss commented Jul 6, 2023

@josevalim @wojtekmach thank you, guys! 💜

@philss philss merged commit d42b4bf into main Jul 6, 2023
2 checks passed
@philss philss deleted the ps-add-retries branch July 6, 2023 20:54

defp with_retry(fun, attempts) when attempts in 0..15 do
task = Task.async(fun)
first_try = Task.await(task, :infinity)
Copy link
Contributor

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?

Copy link
Owner Author

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

Copy link
Contributor

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 :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG 😓
94b2b75

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants