mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 20:05:01 -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
|
@ -494,7 +494,7 @@ class PusherStore(PusherWorkerStore):
|
|||
# invalidate, since we the user might not have had a pusher before
|
||||
await self.db_pool.runInteraction(
|
||||
"add_pusher",
|
||||
self._invalidate_cache_and_stream, # type: ignore
|
||||
self._invalidate_cache_and_stream, # type: ignore[attr-defined]
|
||||
self.get_if_user_has_pusher,
|
||||
(user_id,),
|
||||
)
|
||||
|
@ -503,7 +503,7 @@ class PusherStore(PusherWorkerStore):
|
|||
self, app_id: str, pushkey: str, user_id: str
|
||||
) -> None:
|
||||
def delete_pusher_txn(txn, stream_id):
|
||||
self._invalidate_cache_and_stream( # type: ignore
|
||||
self._invalidate_cache_and_stream( # type: ignore[attr-defined]
|
||||
txn, self.get_if_user_has_pusher, (user_id,)
|
||||
)
|
||||
|
||||
|
@ -548,7 +548,7 @@ class PusherStore(PusherWorkerStore):
|
|||
pushers = list(await self.get_pushers_by_user_id(user_id))
|
||||
|
||||
def delete_pushers_txn(txn, stream_ids):
|
||||
self._invalidate_cache_and_stream( # type: ignore
|
||||
self._invalidate_cache_and_stream( # type: ignore[attr-defined]
|
||||
txn, self.get_if_user_has_pusher, (user_id,)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue