Added small pause before connection retry

This commit is contained in:
Tomas Groth 2014-11-24 19:38:15 +00:00
parent 0af6dc8eea
commit 5b794e5762
2 changed files with 5 additions and 0 deletions

View File

@ -326,6 +326,7 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
return False return False
else: else:
retries += 1 retries += 1
time.sleep(0.1)
continue continue
break break
# Delete file if cancelled, it may be a partial file. # Delete file if cancelled, it may be a partial file.
@ -361,6 +362,7 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
raise raise
else: else:
retries += 1 retries += 1
time.sleep(0.1)
continue continue
def _download_progress(self, count, block_size): def _download_progress(self, count, block_size):

View File

@ -35,6 +35,7 @@ import logging
import locale import locale
import os import os
import re import re
import time
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
import sys import sys
import urllib.request import urllib.request
@ -261,6 +262,7 @@ def check_latest_version(current_version):
log.exception('Failed to download the latest OpenLP version file') log.exception('Failed to download the latest OpenLP version file')
else: else:
retries += 1 retries += 1
time.sleep(0.1)
continue continue
break break
if remote_version: if remote_version:
@ -408,6 +410,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:
time.sleep(0.1)
continue continue
break break
if not page: if not page: