diff options
Diffstat (limited to 'synapse/push/push_rule_evaluator.py')
-rw-r--r-- | synapse/push/push_rule_evaluator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index dca018af95..27b0de4f66 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -309,14 +309,14 @@ def _flatten_dict(d, prefix=[], result={}): return result -regex_cache = LruCache(5000) +regex_cache = LruCache(5000, 1) def _compile_regex(regex_str): - r = regex_cache.get(regex_str, None) + r = regex_cache.get((regex_str,), None) if r: return r r = re.compile(regex_str, flags=re.IGNORECASE) - regex_cache[regex_str] = r + regex_cache[(regex_str,)] = r return r |