Fix duplicated method in ProxyCache
Fixes #10291 Also changed size request to better utilize actual memory
This commit is contained in:
parent
efabb77567
commit
4ae4ac1d12
@ -57,7 +57,10 @@ class CacheProxyDb:
|
||||
if handle:
|
||||
del self.cache_handle[handle]
|
||||
else:
|
||||
self.cache_handle = LRU(100000)
|
||||
# Memory allocation is power of 2 where slots has to fit.
|
||||
# LRU uses one extra slot in its work, so set max to 2^17-1
|
||||
# otherwise we are just wasting memory
|
||||
self.cache_handle = LRU(131071)
|
||||
|
||||
def get_person_from_handle(self, handle):
|
||||
"""
|
||||
@ -104,15 +107,6 @@ class CacheProxyDb:
|
||||
self.cache_handle[handle] = self.db.get_place_from_handle(handle)
|
||||
return self.cache_handle[handle]
|
||||
|
||||
def get_place_from_handle(self, handle):
|
||||
"""
|
||||
Gets item from cache if it exists. Converts
|
||||
handles to string, for uniformity.
|
||||
"""
|
||||
if handle not in self.cache_handle:
|
||||
self.cache_handle[handle] = self.db.get_place_from_handle(handle)
|
||||
return self.cache_handle[handle]
|
||||
|
||||
def get_citation_from_handle(self, handle):
|
||||
"""
|
||||
Gets item from cache if it exists. Converts
|
||||
|
Loading…
Reference in New Issue
Block a user