mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-22 18:24:09 -04:00
Improve type hints in storage classes. (#11652)
By using cast and making ignores more specific.
This commit is contained in:
parent
f58b300d27
commit
f82d38ed2e
10 changed files with 44 additions and 34 deletions
|
@ -288,7 +288,7 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
|
|||
new_front = set()
|
||||
for chunk in batch_iter(front, 100):
|
||||
# Pull the auth events either from the cache or DB.
|
||||
to_fetch = [] # Event IDs to fetch from DB # type: List[str]
|
||||
to_fetch: List[str] = [] # Event IDs to fetch from DB
|
||||
for event_id in chunk:
|
||||
res = self._event_auth_cache.get(event_id)
|
||||
if res is None:
|
||||
|
@ -615,8 +615,8 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
|
|||
# currently walking, either from cache or DB.
|
||||
search, chunk = search[:-100], search[-100:]
|
||||
|
||||
found = [] # Results found # type: List[Tuple[str, str, int]]
|
||||
to_fetch = [] # Event IDs to fetch from DB # type: List[str]
|
||||
found: List[Tuple[str, str, int]] = [] # Results found
|
||||
to_fetch: List[str] = [] # Event IDs to fetch from DB
|
||||
for _, event_id in chunk:
|
||||
res = self._event_auth_cache.get(event_id)
|
||||
if res is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue