diff --git a/lib/entropy/db/cache.py b/lib/entropy/db/cache.py index 7b7417412..1a4e84e4f 100644 --- a/lib/entropy/db/cache.py +++ b/lib/entropy/db/cache.py @@ -9,7 +9,6 @@ I{EntropyRepository} caching interface. """ -import threading import weakref from entropy.core import Singleton @@ -64,7 +63,7 @@ class EntropyRepositoryCacher(Singleton): return obj() return obj - def set(self, key, value, expiration_secs = None): + def set(self, key, value): """ Set item in cache. """ @@ -72,12 +71,3 @@ class EntropyRepositoryCacher(Singleton): self.__live_cache[key] = weakref.ref(value) else: self.__live_cache[key] = value - - if expiration_secs is not None: - timer = threading.Timer( - expiration_secs, - self.__live_cache.pop, - args = (key, None)) - timer.name = "EntropyRepositoryCacher.TimedPop" - timer.daemon = True - timer.start() diff --git a/lib/entropy/db/sql.py b/lib/entropy/db/sql.py index 7bbc37d3f..7e8a8f7c5 100644 --- a/lib/entropy/db/sql.py +++ b/lib/entropy/db/sql.py @@ -849,12 +849,11 @@ class EntropySQLRepository(EntropyRepositoryBase): """ self._live_cacher.discard(self._getLiveCacheKey()) - def _setLiveCache(self, key, value, expiration_secs = None): + def _setLiveCache(self, key, value): """ Save a new key -> value pair to the in-memory cache. """ - self._live_cacher.set(self._getLiveCacheKey() + key, - value, expiration_secs = expiration_secs) + self._live_cacher.set(self._getLiveCacheKey() + key, value) def _getLiveCache(self, key): """