mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 07:24:56 -04:00
Add type hints to response cache. (#8507)
This commit is contained in:
parent
66ac4b1e34
commit
1781bbe319
9 changed files with 48 additions and 34 deletions
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Optional, Tuple
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
|
@ -47,12 +47,14 @@ class InitialSyncHandler(BaseHandler):
|
|||
self.state = hs.get_state_handler()
|
||||
self.clock = hs.get_clock()
|
||||
self.validator = EventValidator()
|
||||
self.snapshot_cache = ResponseCache(hs, "initial_sync_cache")
|
||||
self.snapshot_cache = ResponseCache(
|
||||
hs, "initial_sync_cache"
|
||||
) # type: ResponseCache[Tuple[str, Optional[StreamToken], Optional[StreamToken], str, Optional[int], bool, bool]]
|
||||
self._event_serializer = hs.get_event_client_serializer()
|
||||
self.storage = hs.get_storage()
|
||||
self.state_store = self.storage.state
|
||||
|
||||
def snapshot_all_rooms(
|
||||
async def snapshot_all_rooms(
|
||||
self,
|
||||
user_id: str,
|
||||
pagin_config: PaginationConfig,
|
||||
|
@ -84,7 +86,7 @@ class InitialSyncHandler(BaseHandler):
|
|||
include_archived,
|
||||
)
|
||||
|
||||
return self.snapshot_cache.wrap(
|
||||
return await self.snapshot_cache.wrap(
|
||||
key,
|
||||
self._snapshot_all_rooms,
|
||||
user_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue