diff options
author | Jonathan de Jong <jonathan@automatia.nl> | 2021-07-15 18:46:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 12:46:54 -0400 |
commit | bdfde6dca11a9468372b3c9b327ad3327cbdbe4a (patch) | |
tree | e3185688882f25f08cc0aefa80d8e1944c5004d9 /synapse/storage/util/sequence.py | |
parent | Reduce likelihood of Postgres table scanning `state_groups_state`. (#10359) (diff) | |
download | synapse-bdfde6dca11a9468372b3c9b327ad3327cbdbe4a.tar.xz |
Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381)
Diffstat (limited to 'synapse/storage/util/sequence.py')
-rw-r--r-- | synapse/storage/util/sequence.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/util/sequence.py b/synapse/storage/util/sequence.py index 30b6b8e0ca..bb33e04fb1 100644 --- a/synapse/storage/util/sequence.py +++ b/synapse/storage/util/sequence.py @@ -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) |