Higher connection timeout

- Fixes #73
This commit is contained in:
tomkat83 2016-07-12 21:30:39 +02:00
parent 04e31986b5
commit 3e84f34acc

View file

@ -30,8 +30,6 @@ class DownloadUtils():
# Borg - multiple instances, shared state # Borg - multiple instances, shared state
_shared_state = {} _shared_state = {}
# Requests session
timeout = 30
# How many failed attempts before declaring PMS dead? # How many failed attempts before declaring PMS dead?
connectionAttempts = 2 connectionAttempts = 2
# How many 401 returns before declaring unauthorized? # How many 401 returns before declaring unauthorized?
@ -39,6 +37,8 @@ class DownloadUtils():
def __init__(self): def __init__(self):
self.__dict__ = self._shared_state self.__dict__ = self._shared_state
# Requests session
self.timeout = 30.0
def setUsername(self, username): def setUsername(self, username):
""" """
@ -172,7 +172,7 @@ class DownloadUtils():
xml xml etree root object, if applicable xml xml etree root object, if applicable
JSON json() object, if applicable JSON json() object, if applicable
""" """
kwargs = {} kwargs = {'timeout': self.timeout}
if authenticate is True: if authenticate is True:
# Get requests session # Get requests session
try: try:
@ -188,7 +188,6 @@ class DownloadUtils():
# plex.tv and to check for PMS servers # plex.tv and to check for PMS servers
s = requests s = requests
headerOptions = self.getHeader(options=headerOptions) headerOptions = self.getHeader(options=headerOptions)
kwargs['timeout'] = self.timeout
if settings('sslcert') != 'None': if settings('sslcert') != 'None':
kwargs['cert'] = settings('sslcert') kwargs['cert'] = settings('sslcert')