Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, _function):
self._function = _function
# The performance impact of storing many items in the cached
# (in memory) part of the CachedDiskDict is low. The keys for
# this cache are hashes and the values are booleans
#
# Using the LRUDict instead of SynchronizedLRUDict because this decorator
# is run wrapped around PreventMultipleThreads, and also because we're
# consuming it in a way where thread-generated race condition errors can
# be ignored (they do not generate a big impact)
#
# LRUDict is faster than SynchronizedLRUDict because there are no locks
self._is_404_by_url_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
self._is_404_by_body_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
self._stats_from_cache = 0.0
self._stats_total = 0.0
self._response_cache_key_cache = ResponseCacheKeyCache()
def __init__(self, _function):
self._function = _function
# The performance impact of storing many items in the cached
# (in memory) part of the CachedDiskDict is low. The keys for
# this cache are hashes and the values are booleans
#
# Using the LRUDict instead of SynchronizedLRUDict because this decorator
# is run wrapped around PreventMultipleThreads, and also because we're
# consuming it in a way where thread-generated race condition errors can
# be ignored (they do not generate a big impact)
#
# LRUDict is faster than SynchronizedLRUDict because there are no locks
self._is_404_by_url_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
self._is_404_by_body_lru = LRUDict(capacity=self.MAX_IN_MEMORY_RESULTS)
self._stats_from_cache = 0.0
self._stats_total = 0.0
self._response_cache_key_cache = ResponseCacheKeyCache()