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:
parent
70c2a2d130
commit
a435a7d3d2
@ -15,15 +15,13 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
import threading
|
||||||
import sickbeard
|
import sickbeard
|
||||||
|
|
||||||
from sickbeard import db
|
from sickbeard import db
|
||||||
from sickbeard.helpers import sanitizeSceneName
|
|
||||||
from sickbeard import logger
|
from sickbeard import logger
|
||||||
|
|
||||||
nameCache = None
|
nameCache = None
|
||||||
|
nameCacheLock = threading.Lock()
|
||||||
|
|
||||||
def addNameToCache(name, indexer_id=0):
|
def addNameToCache(name, indexer_id=0):
|
||||||
"""
|
"""
|
||||||
@ -98,6 +96,7 @@ def buildNameCache(show=None):
|
|||||||
if not nameCache:
|
if not nameCache:
|
||||||
nameCache = {}
|
nameCache = {}
|
||||||
|
|
||||||
|
with nameCacheLock:
|
||||||
# clear internal name cache
|
# clear internal name cache
|
||||||
clearCache()
|
clearCache()
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ xem_exception_dict = {}
|
|||||||
exceptionsCache = {}
|
exceptionsCache = {}
|
||||||
exceptionsSeasonCache = {}
|
exceptionsSeasonCache = {}
|
||||||
|
|
||||||
|
exceptionLock = threading.Lock()
|
||||||
|
|
||||||
def shouldRefresh(list):
|
def shouldRefresh(list):
|
||||||
MAX_REFRESH_AGE_SECS = 86400 # 1 day
|
MAX_REFRESH_AGE_SECS = 86400 # 1 day
|
||||||
|
@ -354,9 +354,6 @@ class QueueItemAdd(ShowQueueItem):
|
|||||||
logger.ERROR)
|
logger.ERROR)
|
||||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
|
|
||||||
# before we parse local files lets update exceptions
|
|
||||||
sickbeard.scene_exceptions.retrieve_exceptions()
|
|
||||||
|
|
||||||
# update internal name cache
|
# update internal name cache
|
||||||
name_cache.buildNameCache()
|
name_cache.buildNameCache()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user