1
0
mirror of https://github.com/moparisthebest/SickRage synced 2025-03-04 10:29:52 -05:00

Fixed dailysearcher to only update the cache results for each provider once at start of the dailysearch routine instead of per-show which was wasting cycles and time.

This commit is contained in:
echel0n 2014-06-26 17:13:41 -07:00
parent 858951d31c
commit 301f124cbb
2 changed files with 19 additions and 2 deletions

View File

@ -27,6 +27,8 @@ from sickbeard import db
from sickbeard import common from sickbeard import common
from sickbeard import helpers from sickbeard import helpers
from sickbeard import exceptions from sickbeard import exceptions
from sickbeard.exceptions import ex
class DailySearcher(): class DailySearcher():
def __init__(self): def __init__(self):
@ -38,6 +40,23 @@ class DailySearcher():
self.amActive = True self.amActive = True
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive() and not x.backlog_only]
for curProviderCount, curProvider in enumerate(providers):
try:
logger.log(u"Updating [" + curProvider.name + "} RSS cache ...")
curProvider.cache.updateCache()
except exceptions.AuthException, e:
logger.log(u"Authentication error: " + ex(e), logger.ERROR)
if curProviderCount != len(providers):
continue
break
except Exception, e:
logger.log(u"Error while updating cache for " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
if curProviderCount != len(providers):
continue
break
logger.log(u"Searching for coming episodes and 1 weeks worth of previously WANTED episodes ...") logger.log(u"Searching for coming episodes and 1 weeks worth of previously WANTED episodes ...")
fromDate = datetime.date.today() - datetime.timedelta(weeks=1) fromDate = datetime.date.today() - datetime.timedelta(weeks=1)

View File

@ -355,8 +355,6 @@ def searchForNeededEpisodes(show, episodes):
threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]" threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]"
try: try:
logger.log(u"Updating RSS cache ...")
curProvider.cache.updateCache()
logger.log(u"Searching RSS cache ...") logger.log(u"Searching RSS cache ...")
curFoundResults = curProvider.searchRSS(episodes) curFoundResults = curProvider.searchRSS(episodes)
except exceptions.AuthException, e: except exceptions.AuthException, e: