summary refs log tree commit diff
path: root/synapse/storage/databases/main
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-05-17 17:06:45 +0100
committerGitHub <noreply@github.com>2022-05-17 16:06:45 +0000
commit5331fb5b478789a3ffaaeddb58f8d1cefd42a9eb (patch)
treeabc584252f453004d1323b685d1c70e35a3d1194 /synapse/storage/databases/main
parentAdd some type hints to datastore (#12717) (diff)
downloadsynapse-5331fb5b478789a3ffaaeddb58f8d1cefd42a9eb.tar.xz
allow `on_invalidate=None` in `@cached` methods (#12769)
Diffstat (limited to 'synapse/storage/databases/main')
-rw-r--r--synapse/storage/databases/main/roommember.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py
index 608d40dfa1..cc528fcf2d 100644
--- a/synapse/storage/databases/main/roommember.py
+++ b/synapse/storage/databases/main/roommember.py
@@ -15,6 +15,7 @@
 import logging
 from typing import (
     TYPE_CHECKING,
+    Callable,
     Collection,
     Dict,
     FrozenSet,
@@ -634,7 +635,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
         )
 
     async def get_rooms_for_user(
-        self, user_id: str, on_invalidate=None
+        self, user_id: str, on_invalidate: Optional[Callable[[], None]] = None
     ) -> FrozenSet[str]:
         """Returns a set of room_ids the user is currently joined to.