summary refs log tree commit diff
path: root/synapse/util/caches/expiringcache.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-10-22 20:19:40 +0200
committerMatthew Hodgson <matthew@matrix.org>2018-10-22 20:19:40 +0200
commitc7503f8f335bda84a2c40b659a409df05538868d (patch)
tree8844135554b54605a14287f63a5fe5a0959b0ad8 /synapse/util/caches/expiringcache.py
parentfix missing import and run isort (diff)
parentUse recaptcha_ajax.js directly from Google (diff)
downloadsynapse-c7503f8f335bda84a2c40b659a409df05538868d.tar.xz
merge in master
Diffstat (limited to 'synapse/util/caches/expiringcache.py')
-rw-r--r--synapse/util/caches/expiringcache.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/util/caches/expiringcache.py b/synapse/util/caches/expiringcache.py

index 4abca91f6d..ce85b2ae11 100644 --- a/synapse/util/caches/expiringcache.py +++ b/synapse/util/caches/expiringcache.py
@@ -16,6 +16,7 @@ import logging from collections import OrderedDict +from synapse.metrics.background_process_metrics import run_as_background_process from synapse.util.caches import register_cache logger = logging.getLogger(__name__) @@ -63,7 +64,10 @@ class ExpiringCache(object): return def f(): - self._prune_cache() + return run_as_background_process( + "prune_cache_%s" % self._cache_name, + self._prune_cache, + ) self._clock.looping_call(f, self._expiry_ms / 2)