bin/proxy.py: handle query timeouts

pull/339/head
Igor Chubin 5 years ago
parent eecd88794c
commit d78996af54

@ -188,10 +188,14 @@ def proxy(path):
url = '%s/%s?%s' % (srv, path, query_string)
print(url)
attempts = 5
attempts = 10
response = None
while attempts:
try:
response = requests.get(url, timeout=2)
except requests.ReadTimeout:
attempts -= 1
continue
try:
json.loads(response.content)
break

Loading…
Cancel
Save