|
15 | 15 |
|
16 | 16 | import itertools |
17 | 17 | import logging |
18 | | -from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple |
| 18 | +from typing import TYPE_CHECKING, Any, Collection, Iterable, List, Optional, Tuple |
19 | 19 |
|
20 | 20 | from synapse.api.constants import EventTypes |
21 | 21 | from synapse.replication.tcp.streams import BackfillStream, CachesStream |
|
25 | 25 | EventsStreamEventRow, |
26 | 26 | ) |
27 | 27 | from synapse.storage._base import SQLBaseStore |
28 | | -from synapse.storage.database import DatabasePool, LoggingDatabaseConnection |
| 28 | +from synapse.storage.database import ( |
| 29 | + DatabasePool, |
| 30 | + LoggingDatabaseConnection, |
| 31 | + LoggingTransaction, |
| 32 | +) |
29 | 33 | from synapse.storage.engines import PostgresEngine |
30 | 34 | from synapse.util.iterutils import batch_iter |
31 | 35 |
|
@@ -236,16 +240,18 @@ def _invalidate_all_cache_and_stream(self, txn, cache_func): |
236 | 240 | txn.call_after(cache_func.invalidate_all) |
237 | 241 | self._send_invalidation_to_replication(txn, cache_func.__name__, None) |
238 | 242 |
|
239 | | - def _invalidate_state_caches_and_stream(self, txn, room_id, members_changed): |
| 243 | + def _invalidate_state_caches_and_stream( |
| 244 | + self, txn: LoggingTransaction, room_id: str, members_changed: Collection[str] |
| 245 | + ) -> None: |
240 | 246 | """Special case invalidation of caches based on current state. |
241 | 247 |
|
242 | 248 | We special case this so that we can batch the cache invalidations into a |
243 | 249 | single replication poke. |
244 | 250 |
|
245 | 251 | Args: |
246 | 252 | txn |
247 | | - room_id (str): Room where state changed |
248 | | - members_changed (iterable[str]): The user_ids of members that have changed |
| 253 | + room_id: Room where state changed |
| 254 | + members_changed: The user_ids of members that have changed |
249 | 255 | """ |
250 | 256 | txn.call_after(self._invalidate_state_caches, room_id, members_changed) |
251 | 257 |
|
|
0 commit comments