summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-10-16 15:51:57 +0100
committerGitHub <noreply@github.com>2020-10-16 15:51:57 +0100
commit3ee17585cd095e590096683395cfb9a017eac15e (patch)
tree65ada1e25106be58ddba381f366c48c4ce4e5d91 /synapse/push
parentFix modifying events in `ThirdPartyRules` modules (#8564) (diff)
downloadsynapse-3ee17585cd095e590096683395cfb9a017eac15e.tar.xz
Make LruCache register its own metrics (#8561)
rather than have everything that instantiates an LruCache manage metrics
separately, have LruCache do it itself.
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/push_rule_evaluator.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py
index 3a68ce636f..4c95b149c5 100644
--- a/synapse/push/push_rule_evaluator.py
+++ b/synapse/push/push_rule_evaluator.py
@@ -20,7 +20,6 @@ from typing import Any, Dict, List, Optional, Pattern, Union
 
 from synapse.events import EventBase
 from synapse.types import UserID
-from synapse.util.caches import register_cache
 from synapse.util.caches.lrucache import LruCache
 
 logger = logging.getLogger(__name__)
@@ -186,8 +185,7 @@ class PushRuleEvaluatorForEvent:
 
 
 # Caches (string, is_glob, word_boundary) -> regex for push. See _glob_matches
-regex_cache = LruCache(50000)
-register_cache("cache", "regex_push_cache", regex_cache)
+regex_cache = LruCache(50000, "regex_push_cache")
 
 
 def _glob_matches(glob: str, value: str, word_boundary: bool = False) -> bool: