mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-05 09:24:16 -04:00
Make LruCache register its own metrics (#8561)
rather than have everything that instantiates an LruCache manage metrics separately, have LruCache do it itself.
This commit is contained in:
parent
da0090fdff
commit
3ee17585cd
8 changed files with 62 additions and 62 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue