mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-23 00:30:40 -04:00
Use an enum for direction. (#14927)
For better type safety we use an enum instead of strings to configure direction (backwards or forwards).
This commit is contained in:
parent
fc35e0673f
commit
265735db9d
9 changed files with 76 additions and 44 deletions
|
@ -15,7 +15,13 @@
|
|||
import logging
|
||||
from typing import TYPE_CHECKING, List, Optional, Tuple, cast
|
||||
|
||||
from synapse.api.constants import AccountDataTypes, EduTypes, EventTypes, Membership
|
||||
from synapse.api.constants import (
|
||||
AccountDataTypes,
|
||||
Direction,
|
||||
EduTypes,
|
||||
EventTypes,
|
||||
Membership,
|
||||
)
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.events import EventBase
|
||||
from synapse.events.utils import SerializeEventConfig
|
||||
|
@ -57,7 +63,13 @@ class InitialSyncHandler:
|
|||
self.validator = EventValidator()
|
||||
self.snapshot_cache: ResponseCache[
|
||||
Tuple[
|
||||
str, Optional[StreamToken], Optional[StreamToken], str, int, bool, bool
|
||||
str,
|
||||
Optional[StreamToken],
|
||||
Optional[StreamToken],
|
||||
Direction,
|
||||
int,
|
||||
bool,
|
||||
bool,
|
||||
]
|
||||
] = ResponseCache(hs.get_clock(), "initial_sync_cache")
|
||||
self._event_serializer = hs.get_event_client_serializer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue