From 3e84f34acc7081c0ff2a14c9d7a928db526fa6e5 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Tue, 12 Jul 2016 21:30:39 +0200 Subject: [PATCH] Higher connection timeout - Fixes #73 --- resources/lib/downloadutils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 24aea4e5..e0c8a06e 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -30,8 +30,6 @@ class DownloadUtils(): # Borg - multiple instances, shared state _shared_state = {} - # Requests session - timeout = 30 # How many failed attempts before declaring PMS dead? connectionAttempts = 2 # How many 401 returns before declaring unauthorized? @@ -39,6 +37,8 @@ class DownloadUtils(): def __init__(self): self.__dict__ = self._shared_state + # Requests session + self.timeout = 30.0 def setUsername(self, username): """ @@ -172,7 +172,7 @@ class DownloadUtils(): xml xml etree root object, if applicable JSON json() object, if applicable """ - kwargs = {} + kwargs = {'timeout': self.timeout} if authenticate is True: # Get requests session try: @@ -188,7 +188,6 @@ class DownloadUtils(): # plex.tv and to check for PMS servers s = requests headerOptions = self.getHeader(options=headerOptions) - kwargs['timeout'] = self.timeout if settings('sslcert') != 'None': kwargs['cert'] = settings('sslcert')