diff options
author | Will Hunt <willh@matrix.org> | 2021-07-20 09:35:03 +0100 |
---|---|---|
committer | Will Hunt <willh@matrix.org> | 2021-07-20 09:35:03 +0100 |
commit | f19795355bf31af3842e607b3f1cc34e5d7727dc (patch) | |
tree | 85834d47d9f4610fcf70f176114aa17a7b61b8e4 /synapse/storage/util/sequence.py | |
parent | Merge remote-tracking branch 'origin/develop' into hs/hacked-together-event-c... (diff) | |
parent | Factorise `get_datastore` calls in phone_stats_home. (#10427) (diff) | |
download | synapse-f19795355bf31af3842e607b3f1cc34e5d7727dc.tar.xz |
Merge remote-tracking branch 'origin/develop' into hs/hacked-together-event-cache
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) |