mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -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:
parent
858951d31c
commit
301f124cbb
@ -27,6 +27,8 @@ from sickbeard import db
|
||||
from sickbeard import common
|
||||
from sickbeard import helpers
|
||||
from sickbeard import exceptions
|
||||
from sickbeard.exceptions import ex
|
||||
|
||||
|
||||
class DailySearcher():
|
||||
def __init__(self):
|
||||
@ -38,6 +40,23 @@ class DailySearcher():
|
||||
|
||||
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 ...")
|
||||
|
||||
fromDate = datetime.date.today() - datetime.timedelta(weeks=1)
|
||||
|
@ -355,8 +355,6 @@ def searchForNeededEpisodes(show, episodes):
|
||||
threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]"
|
||||
|
||||
try:
|
||||
logger.log(u"Updating RSS cache ...")
|
||||
curProvider.cache.updateCache()
|
||||
logger.log(u"Searching RSS cache ...")
|
||||
curFoundResults = curProvider.searchRSS(episodes)
|
||||
except exceptions.AuthException, e:
|
||||
|
Loading…
Reference in New Issue
Block a user