From c9fb203ce0fa8705b33d18f86fc77549c1e1522b Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 15 Sep 2021 14:06:21 +0100 Subject: Allow LruCaches to opt out of time-based expiry --- synapse/util/caches/deferred_cache.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'synapse/util/caches/deferred_cache.py') diff --git a/synapse/util/caches/deferred_cache.py b/synapse/util/caches/deferred_cache.py index f05590da0d..6262efe072 100644 --- a/synapse/util/caches/deferred_cache.py +++ b/synapse/util/caches/deferred_cache.py @@ -73,6 +73,7 @@ class DeferredCache(Generic[KT, VT]): tree: bool = False, iterable: bool = False, apply_cache_factor_from_config: bool = True, + prune_unread_entries: bool = True, ): """ Args: @@ -105,6 +106,7 @@ class DeferredCache(Generic[KT, VT]): size_callback=(lambda d: len(d) or 1) if iterable else None, metrics_collection_callback=metrics_cb, apply_cache_factor_from_config=apply_cache_factor_from_config, + prune_unread_entries=prune_unread_entries, ) self.thread: Optional[threading.Thread] = None -- cgit 1.5.1