mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 05:34:57 -04:00
Add an additional HTTP pusher + push rule tests. (#12188)
And rename the field used for caching from _id to _cache_key.
This commit is contained in:
parent
003cc6910a
commit
735e89bd3a
5 changed files with 95 additions and 28 deletions
|
@ -274,17 +274,17 @@ def _condition_checker(
|
|||
cache: Dict[str, bool],
|
||||
) -> bool:
|
||||
for cond in conditions:
|
||||
_id = cond.get("_id", None)
|
||||
if _id:
|
||||
res = cache.get(_id, None)
|
||||
_cache_key = cond.get("_cache_key", None)
|
||||
if _cache_key:
|
||||
res = cache.get(_cache_key, None)
|
||||
if res is False:
|
||||
return False
|
||||
elif res is True:
|
||||
continue
|
||||
|
||||
res = evaluator.matches(cond, uid, display_name)
|
||||
if _id:
|
||||
cache[_id] = bool(res)
|
||||
if _cache_key:
|
||||
cache[_cache_key] = bool(res)
|
||||
|
||||
if not res:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue