vericast / conda-mirror

Mirror upstream conda channels
BSD 3-Clause "New" or "Revised" License
72 stars 60 forks source link

How to catch stalling HTTP connections? #66

Open willirath opened 6 years ago

willirath commented 6 years ago

I'm struggling with an uplink that has stalling HTTP connections from time to time. Currently, conda-mirror just seems to wait forever if this happens during a download. Is there any easy way of adding a timeout / retry on timeout here?

magnuhho commented 6 years ago

We should set a timeout on the requests.get call in _download, ref. http://docs.python-requests.org/en/master/user/quickstart/#timeouts

This change can be implemented as a command line argument (--timeout) with a default value.

What would be a good value, though? A quick web seearch suggests some products use 10 seconds while other use 2-3 minutes +