andrewkroh / gvm

Go Version Manager (written in Go for cross-platform usability)
Apache License 2.0
186 stars 24 forks source link

retry file downloads 3 times #15

Closed graphaelli closed 5 years ago

graphaelli commented 5 years ago

and set timeout on http get.

In an attempt to combat CI issues like:

gvm: error: http get failed: Get https://storage.googleapis.com/golang/go1.11.4.linux-amd64.tar.gz: dial tcp 173.194.197.128:443: i/o timeout
urso commented 5 years ago

DownloadFile is generic enough, that I'd like to make it a little more 'configurable' + expose some settings to the CLI (e.g. timeout, number of retries, backoff).

Currently the function is only used by (*Manager).installBinary, which is used by gvm use, and gvm install.

graphaelli commented 5 years ago

@urso do you prefer to do that all now or good with merging this in as is? I intentionally avoided changing the signature of DownloadFile just in case. Please feel free to merge/close either way.

andrewkroh commented 5 years ago

@graphaelli Do you want to make a release with this?

This is what I've done in the past.

graphaelli commented 5 years ago

All set, thanks for the great instructions. For the final step, did that from https://github.com/andrewkroh/gvm/releases/new?tag=v0.2.0. Please let me know if I missed anything

andrewkroh commented 5 years ago

LGTM. Thanks for doing it.