mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:36:06 -04:00
Add ReadWriteLock for pagination and history prune
This commit is contained in:
parent
7335f0adda
commit
8f8798bc0d
2 changed files with 41 additions and 39 deletions
|
@ -487,13 +487,13 @@ class StreamStore(SQLBaseStore):
|
|||
row["topological_ordering"], row["stream_ordering"],)
|
||||
)
|
||||
|
||||
def get_max_topological_token_for_stream_and_room(self, room_id, stream_key):
|
||||
def get_max_topological_token(self, room_id, stream_key):
|
||||
sql = (
|
||||
"SELECT max(topological_ordering) FROM events"
|
||||
" WHERE room_id = ? AND stream_ordering < ?"
|
||||
)
|
||||
return self._execute(
|
||||
"get_max_topological_token_for_stream_and_room", None,
|
||||
"get_max_topological_token", None,
|
||||
sql, room_id, stream_key,
|
||||
).addCallback(
|
||||
lambda r: r[0][0] if r else 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue