mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 07:12:28 -04:00
Use inline type hints in http/federation/
, storage/
and util/
(#10381)
This commit is contained in:
parent
3acf85c85f
commit
bdfde6dca1
38 changed files with 149 additions and 161 deletions
|
@ -92,14 +92,12 @@ class BackgroundUpdater:
|
|||
self.db_pool = database
|
||||
|
||||
# if a background update is currently running, its name.
|
||||
self._current_background_update = None # type: Optional[str]
|
||||
self._current_background_update: Optional[str] = None
|
||||
|
||||
self._background_update_performance = (
|
||||
{}
|
||||
) # type: Dict[str, BackgroundUpdatePerformance]
|
||||
self._background_update_handlers = (
|
||||
{}
|
||||
) # type: Dict[str, Callable[[JsonDict, int], Awaitable[int]]]
|
||||
self._background_update_performance: Dict[str, BackgroundUpdatePerformance] = {}
|
||||
self._background_update_handlers: Dict[
|
||||
str, Callable[[JsonDict, int], Awaitable[int]]
|
||||
] = {}
|
||||
self._all_done = False
|
||||
|
||||
def start_doing_background_updates(self) -> None:
|
||||
|
@ -411,7 +409,7 @@ class BackgroundUpdater:
|
|||
c.execute(sql)
|
||||
|
||||
if isinstance(self.db_pool.engine, engines.PostgresEngine):
|
||||
runner = create_index_psql # type: Optional[Callable[[Connection], None]]
|
||||
runner: Optional[Callable[[Connection], None]] = create_index_psql
|
||||
elif psql_only:
|
||||
runner = None
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue