summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-09-22 22:48:58 -0500
committerEric Eastwood <erice@element.io>2022-09-22 22:48:58 -0500
commitb9be6c5b5d2eba58d82c8f4d93dce4f4b49d42e5 (patch)
tree0f2620d981d305af7d50949d1fa4c3ceea029e88 /synapse
parentAdd test to make sure we can actually clear entries just by room_id (diff)
downloadsynapse-b9be6c5b5d2eba58d82c8f4d93dce4f4b49d42e5.tar.xz
Raise exception so we don't run into this arg mismatch again
Diffstat (limited to 'synapse')
-rw-r--r--synapse/util/caches/descriptors.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py
index 3909f1caea..0391966462 100644
--- a/synapse/util/caches/descriptors.py
+++ b/synapse/util/caches/descriptors.py
@@ -431,6 +431,12 @@ class DeferredCacheListDescriptor(_CacheDescriptorBase):
         cache: DeferredCache[CacheKey, Any] = cached_method.cache
         num_args = cached_method.num_args
 
+        if num_args != self.num_args:
+            raise Exception(
+                "Number of args (%s) does not match underlying cache_method_name=%s (%s)."
+                % (self.num_args, self.cached_method_name, num_args)
+            )
+
         @functools.wraps(self.orig)
         def wrapped(*args: Any, **kwargs: Any) -> "defer.Deferred[Dict]":
             # If we're passed a cache_context then we'll want to call its