Improve performance of getting unread counts in rooms (#13119)

This commit is contained in:
Erik Johnston 2022-06-29 11:32:38 +01:00 committed by GitHub
parent cdc0259449
commit 92a0c18ef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 4 deletions

View file

@ -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,