From ac19e018fae5f752c307a5905230f7203290f4c5 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 9 Jan 2015 07:38:10 -0800 Subject: [PATCH] Fix retries on connection timeout error --- openlp/core/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index ece8011ac..257351758 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -401,7 +401,7 @@ def get_web_page(url, header=None, update_openlp=False): req.add_header(header[0], header[1]) page = None log.debug('Downloading URL = %s' % url) - retries = 0 + retries = 1 while True: try: 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') raise else: + retries += 1 time.sleep(0.1) continue break