anoa/temp_working_cache_config
Amber H. Brown 2020-02-27 23:18:12 +11:00
parent 0fc0a7deb8
commit 965e259426
2 changed files with 2 additions and 4 deletions

View File

@ -16,7 +16,6 @@
import threading
from functools import wraps
from synapse.config import cache as cache_config
from synapse.util.caches.treecache import TreeCache
@ -79,7 +78,7 @@ class LruCache(object):
# Save the original max size, and apply the default size factor.
self._original_max_size = max_size
self.max_size = int(max_size * cache_config.DEFAULT_CACHE_SIZE_FACTOR)
self.max_size = int(max_size)
list_root = _Node(None, None, None, None)
list_root.next_node = list_root

View File

@ -20,7 +20,6 @@ from six import integer_types
from sortedcontainers import SortedDict
from synapse.config import cache as cache_config
from synapse.util import caches
logger = logging.getLogger(__name__)
@ -38,7 +37,7 @@ class StreamChangeCache(object):
def __init__(self, name, current_stream_pos, max_size=10000, prefilled_cache=None):
self._original_max_size = max_size
self.max_size = math.floor(max_size * cache_config.DEFAULT_CACHE_SIZE_FACTOR)
self.max_size = math.floor(max_size)
self._entity_to_key = {}
self._cache = SortedDict()
self._earliest_known_stream_pos = current_stream_pos