allow on_invalidate=None in @cached methods (#12769)

This commit is contained in:
David Robertson 2022-05-17 17:06:45 +01:00 committed by GitHub
parent 6edefef602
commit 5331fb5b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 10 deletions

View file

@ -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.