bug 1165347 - use retries for symbol uploads. r=gps

--HG--
extra : rebase_source : 57386c02182d3a1b4b11757a660b9a7eda4fe860
This commit is contained in:
Ted Mielczarek 2015-05-15 13:48:16 -04:00
Родитель 46f8e7ceee
Коммит 89ef156852
1 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -15,6 +15,7 @@
from __future__ import print_function
import os
import redo
import requests
import sys
@ -46,13 +47,15 @@ def main():
print('Uploading symbol file "{0}" to "{1}"...'.format(sys.argv[1], url))
try:
r = requests.post(
url,
files={'symbols.zip': open(sys.argv[1], 'rb')},
headers={'Auth-Token': auth_token},
allow_redirects=False,
timeout=120,
)
with redo.retrying(requests.post,
cleanup=lambda: print('Retrying...'),
retry_exceptions=(requests.exceptions.RequestException,)) as post:
r = post(
url,
files={'symbols.zip': open(sys.argv[1], 'rb')},
headers={'Auth-Token': auth_token},
allow_redirects=False,
timeout=120)
except requests.exceptions.RequestException as e:
print('Error: {0}'.format(e))
return 1