mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 16:44:49 -04:00
Fix a memory leak when running the unit tests. (#13798)
This commit is contained in:
parent
eaed4e6113
commit
cf65433de2
3 changed files with 8 additions and 6 deletions
|
@ -205,8 +205,9 @@ def register_cache(
|
|||
add_resizable_cache(cache_name, resize_callback)
|
||||
|
||||
metric = CacheMetric(cache, cache_type, cache_name, collect_callback)
|
||||
metric_name = "cache_%s_%s" % (cache_type, cache_name)
|
||||
caches_by_name[cache_name] = cache
|
||||
CACHE_METRIC_REGISTRY.register_hook(metric.collect)
|
||||
CACHE_METRIC_REGISTRY.register_hook(metric_name, metric.collect)
|
||||
return metric
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue