[entropy.db] EntropyRepository: create __getLiveCacheKey method
This commit is contained in:
@@ -570,23 +570,21 @@ class EntropyRepository(EntropyRepositoryBase):
|
||||
"""
|
||||
self._cursor().execute('PRAGMA default_cache_size = %s' % (size,))
|
||||
|
||||
def __clearLiveCache(self, key):
|
||||
master_key = etpConst['systemroot'] + "_" + self._db_path + "_" + \
|
||||
def __getLiveCacheKey(self):
|
||||
return etpConst['systemroot'] + "_" + self._db_path + "_" + \
|
||||
self.reponame + "_"
|
||||
|
||||
def __clearLiveCache(self, key):
|
||||
try:
|
||||
del EntropyRepository._LIVE_CACHE[master_key + key]
|
||||
del EntropyRepository._LIVE_CACHE[self.__getLiveCacheKey() + key]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def __setLiveCache(self, key, value):
|
||||
master_key = etpConst['systemroot'] + "_" + self._db_path + "_" + \
|
||||
self.reponame + "_"
|
||||
EntropyRepository._LIVE_CACHE[master_key + key] = value
|
||||
EntropyRepository._LIVE_CACHE[self.__getLiveCacheKey() + key] = value
|
||||
|
||||
def __getLiveCache(self, key):
|
||||
master_key = etpConst['systemroot'] + "_" + self._db_path + "_" + \
|
||||
self.reponame + "_"
|
||||
return EntropyRepository._LIVE_CACHE.get(master_key + key)
|
||||
return EntropyRepository._LIVE_CACHE.get(self.__getLiveCacheKey() + key)
|
||||
|
||||
def __del__(self):
|
||||
self.closeDB()
|
||||
|
||||
Reference in New Issue
Block a user