mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-28 16:24:56 +01:00
SERVER-18262 retry links download multiple times before failing
Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
This commit is contained in:
parent
5a59debb34
commit
9da229e234
@ -76,7 +76,17 @@ class MultiVersionDownloader :
|
||||
href = "http://dl.mongodb.org/dl/%s/%s" \
|
||||
% (self.platform.lower(), self.arch)
|
||||
|
||||
html = urllib2.urlopen(href).read()
|
||||
attempts_remaining = 5
|
||||
timeout_seconds = 10
|
||||
while True:
|
||||
try:
|
||||
html = urllib2.urlopen(href, timeout = timeout_seconds).read()
|
||||
break
|
||||
except Exception as e:
|
||||
print "fetching links failed (%s), retrying..." % e
|
||||
attempts_remaining -= 1
|
||||
if attempts_remaining == 0 :
|
||||
raise Exception("Failed to get links after multiple retries")
|
||||
|
||||
links = {}
|
||||
for line in html.split():
|
||||
|
Loading…
Reference in New Issue
Block a user