bin/proxy.py: handle query timeouts
This commit is contained in:
parent
eecd88794c
commit
d78996af54
1 changed files with 6 additions and 2 deletions
|
|
@ -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…
Add table
Reference in a new issue