mirror of
https://gitlab.com/openlp/openlp.git
synced 2024-09-29 11:27:36 +00:00
Fix retries on connection timeout error
This commit is contained in:
parent
d31a290206
commit
ac19e018fa
@ -401,7 +401,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
|||||||
req.add_header(header[0], header[1])
|
req.add_header(header[0], header[1])
|
||||||
page = None
|
page = None
|
||||||
log.debug('Downloading URL = %s' % url)
|
log.debug('Downloading URL = %s' % url)
|
||||||
retries = 0
|
retries = 1
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
page = urllib.request.urlopen(req, timeout=CONNECTION_TIMEOUT)
|
page = urllib.request.urlopen(req, timeout=CONNECTION_TIMEOUT)
|
||||||
@ -411,6 +411,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
|||||||
log.exception('The web page could not be downloaded')
|
log.exception('The web page could not be downloaded')
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
retries += 1
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user