mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-19 11:40:26 -04:00
Don't apply cache factor to event cache. (#7578)
This is already correctly done when we instansiate the cache, but wasn't when it got reloaded (which always happens at least once on startup).
This commit is contained in:
parent
9bac5d62b3
commit
eefc6b3a0d
3 changed files with 21 additions and 0 deletions
|
@ -81,6 +81,7 @@ class LruCache(object):
|
|||
"""
|
||||
cache = cache_type()
|
||||
self.cache = cache # Used for introspection.
|
||||
self.apply_cache_factor_from_config = apply_cache_factor_from_config
|
||||
|
||||
# Save the original max size, and apply the default size factor.
|
||||
self._original_max_size = max_size
|
||||
|
@ -294,6 +295,9 @@ class LruCache(object):
|
|||
Returns:
|
||||
bool: Whether the cache changed size or not.
|
||||
"""
|
||||
if not self.apply_cache_factor_from_config:
|
||||
return False
|
||||
|
||||
new_size = int(self._original_max_size * factor)
|
||||
if new_size != self.max_size:
|
||||
self.max_size = new_size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue