mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-08 08:52:39 -04:00
Improve performance of getting unread counts in rooms (#13119)
This commit is contained in:
parent
cdc0259449
commit
92a0c18ef0
6 changed files with 40 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue