diff options
author | Erik Johnston <erik@matrix.org> | 2022-06-29 11:32:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 10:32:38 +0000 |
commit | 92a0c18ef0f42b80e382667141e6593ab30e3776 (patch) | |
tree | 5785ed61de85b649bb7e75445a197d28340fe6f0 /synapse/storage/databases/main/stream.py | |
parent | Document the `--report-stats` argument (#13029) (diff) | |
download | synapse-92a0c18ef0f42b80e382667141e6593ab30e3776.tar.xz |
Improve performance of getting unread counts in rooms (#13119)
Diffstat (limited to 'synapse/storage/databases/main/stream.py')
-rw-r--r-- | synapse/storage/databases/main/stream.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/stream.py b/synapse/storage/databases/main/stream.py index 8e88784d3c..3a1df7776c 100644 --- a/synapse/storage/databases/main/stream.py +++ b/synapse/storage/databases/main/stream.py @@ -46,10 +46,12 @@ from typing import ( Set, Tuple, cast, + overload, ) import attr from frozendict import frozendict +from typing_extensions import Literal from twisted.internet import defer @@ -795,6 +797,24 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): ) return RoomStreamToken(topo, stream_ordering) + @overload + def get_stream_id_for_event_txn( + self, + txn: LoggingTransaction, + event_id: str, + allow_none: Literal[False] = False, + ) -> int: + ... + + @overload + def get_stream_id_for_event_txn( + self, + txn: LoggingTransaction, + event_id: str, + allow_none: bool = False, + ) -> Optional[int]: + ... + def get_stream_id_for_event_txn( self, txn: LoggingTransaction, |