Increase timeouts for PMS

- Fixes #283
This commit is contained in:
tomkat83 2017-04-30 17:45:45 +02:00
parent 0a835d7449
commit e05bc6e126
2 changed files with 2 additions and 4 deletions

View file

@ -255,7 +255,6 @@ class PlexAPI():
""" """
Checks connection to a Plex server, available at url. Can also be used Checks connection to a Plex server, available at url. Can also be used
to check for connection with plex.tv. to check for connection with plex.tv.
Will check up to 3x until reply with False
Override SSL to skip the check by setting verifySSL=False Override SSL to skip the check by setting verifySSL=False
if 'None', SSL will be checked (standard requests setting) if 'None', SSL will be checked (standard requests setting)
@ -284,14 +283,13 @@ class PlexAPI():
url = url + '/library/onDeck' url = url + '/library/onDeck'
log.debug("Checking connection to server %s with verifySSL=%s" log.debug("Checking connection to server %s with verifySSL=%s"
% (url, verifySSL)) % (url, verifySSL))
# Check up to 3 times before giving up
count = 0 count = 0
while count < 1: while count < 1:
answer = self.doUtils(url, answer = self.doUtils(url,
authenticate=False, authenticate=False,
headerOptions=headerOptions, headerOptions=headerOptions,
verifySSL=verifySSL, verifySSL=verifySSL,
timeout=4) timeout=10)
if answer is None: if answer is None:
log.debug("Could not connect to %s" % url) log.debug("Could not connect to %s" % url)
count += 1 count += 1

View file

@ -377,7 +377,7 @@ def GetMachineIdentifier(url):
xml = downloadutils.DownloadUtils().downloadUrl('%s/identity' % url, xml = downloadutils.DownloadUtils().downloadUrl('%s/identity' % url,
authenticate=False, authenticate=False,
verifySSL=False, verifySSL=False,
timeout=4) timeout=10)
try: try:
machineIdentifier = xml.attrib['machineIdentifier'] machineIdentifier = xml.attrib['machineIdentifier']
except (AttributeError, KeyError): except (AttributeError, KeyError):