From 7da2dd882e5ac462dbe00e1c2ef7d272e3968349 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Mon, 27 Jan 2014 11:13:56 +1030 Subject: [PATCH] added "wait_for" for SickBeard. Fixes #247 --- autoProcess/autoProcessTV.py | 10 +++++++--- autoProcessMedia.cfg.sample | 1 + changelog.txt | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/autoProcess/autoProcessTV.py b/autoProcess/autoProcessTV.py index 951b0ffc..a5c1e432 100644 --- a/autoProcess/autoProcessTV.py +++ b/autoProcess/autoProcessTV.py @@ -13,9 +13,6 @@ from nzbToMediaUtil import * from nzbToMediaSceneExceptions import process_all_exceptions Logger = logging.getLogger() -TimeOut = 4 * int(TimeOut) # SickBeard needs to complete all moving and renaming before returning the log sequence via url. -socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. - class AuthURLOpener(urllib.FancyURLopener): def __init__(self, user, pw): @@ -99,6 +96,13 @@ def processEpisode(dirName, nzbName=None, failed=False, inputCategory=None): delay = float(config.get(section, "delay")) except (ConfigParser.NoOptionError, ValueError): delay = 0 + try: + wait_for = int(config.get(section, "wait_for")) + except (ConfigParser.NoOptionError, ValueError): + waitfor = 5 + + TimeOut = 60 * int(waitfor) # SickBeard needs to complete all moving and renaming before returning the log sequence via url. + socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') minSampleSize = int(config.get("Extensions", "minSampleSize")) diff --git a/autoProcessMedia.cfg.sample b/autoProcessMedia.cfg.sample index ec6dc726..51b85a29 100644 --- a/autoProcessMedia.cfg.sample +++ b/autoProcessMedia.cfg.sample @@ -31,6 +31,7 @@ password = web_root = ssl = 0 delay = 0 +wait_for = 5 watch_dir = fork = default delete_failed = 0 diff --git a/changelog.txt b/changelog.txt index def08cf2..77ed7ef4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ V9.2 XX/02/2014 Impacts All Change default "wait_for" to 5 mins. CouchPotato can take more than 2 minutes to return on renamer.scan request. +Added SickBeard "wait_for" to bw customizable to prevent unwanted timeouts. V9.1 24/01/2014