mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 16:14:49 -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
|
@ -208,10 +208,10 @@ class LocalSequenceGenerator(SequenceGenerator):
|
|||
get_next_id_txn; should return the curreent maximum id
|
||||
"""
|
||||
# the callback. this is cleared after it is called, so that it can be GCed.
|
||||
self._callback = get_first_callback # type: Optional[GetFirstCallbackType]
|
||||
self._callback: Optional[GetFirstCallbackType] = get_first_callback
|
||||
|
||||
# The current max value, or None if we haven't looked in the DB yet.
|
||||
self._current_max_id = None # type: Optional[int]
|
||||
self._current_max_id: Optional[int] = None
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def get_next_id_txn(self, txn: Cursor) -> int:
|
||||
|
@ -274,7 +274,7 @@ def build_sequence_generator(
|
|||
`check_consistency` details.
|
||||
"""
|
||||
if isinstance(database_engine, PostgresEngine):
|
||||
seq = PostgresSequenceGenerator(sequence_name) # type: SequenceGenerator
|
||||
seq: SequenceGenerator = PostgresSequenceGenerator(sequence_name)
|
||||
else:
|
||||
seq = LocalSequenceGenerator(get_first_callback)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue