1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 19:12:26 -05:00

Added thread lock for internal name cache.

Removed unrequired scene exception retrieval during adding of new shows.
This commit is contained in:
echel0n 2014-07-17 19:37:14 -07:00
parent 70c2a2d130
commit a435a7d3d2
3 changed files with 34 additions and 37 deletions

View File

@ -15,15 +15,13 @@
#
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
import threading
import sickbeard
from sickbeard import db
from sickbeard.helpers import sanitizeSceneName
from sickbeard import logger
nameCache = None
nameCacheLock = threading.Lock()
def addNameToCache(name, indexer_id=0):
"""
@ -98,6 +96,7 @@ def buildNameCache(show=None):
if not nameCache:
nameCache = {}
with nameCacheLock:
# clear internal name cache
clearCache()

View File

@ -34,6 +34,7 @@ xem_exception_dict = {}
exceptionsCache = {}
exceptionsSeasonCache = {}
exceptionLock = threading.Lock()
def shouldRefresh(list):
MAX_REFRESH_AGE_SECS = 86400 # 1 day

View File

@ -354,9 +354,6 @@ class QueueItemAdd(ShowQueueItem):
logger.ERROR)
logger.log(traceback.format_exc(), logger.DEBUG)
# before we parse local files lets update exceptions
sickbeard.scene_exceptions.retrieve_exceptions()
# update internal name cache
name_cache.buildNameCache()