Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prevent concurrent downloads using singleflight #99

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

Conversation

kyleconroy
Copy link

Only attempt to download a given URL once in a given Go process. The singflight package ensures that an action will only be taken once for a set of concurrent Go routines. Other Go rountines will wait until the operation has completed.

Only attempt to download a given URL once in a given Go process. The
singflight package ensures that an action will only be taken once for a
set of concurrent Go routines. Other Go rountines will wait until the
operation has completed.
@kyleconroy
Copy link
Author

I think I've got to the point where the test failure aren't due to my change.

=== RUN   Test_AllMajorVersions/MajorVersion_11.18.0
panic: test timed out after 10m0s

@fergusstrange
Copy link
Owner

Hey @kyleconroy,

We're not keen on introducing any dependencies into the library. The work done at #105 appears to be almost identical, and has some small changes to remove the current usage of the atomic library.

Feel free to chip in there and also let me know if this PR was intended to solve a different issue?

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.

2 participants