mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-13 03:30:50 -05:00
Make deleting push actions more efficient
There's no index on received_ts, so manually binary search using the stream_ordering index, and only update it once an hour.
This commit is contained in:
parent
149fa411e2
commit
d4503e25ed
3 changed files with 68 additions and 13 deletions
|
|
@ -88,6 +88,7 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||
|
||||
def __init__(self, db_conn, hs):
|
||||
self.hs = hs
|
||||
self._clock = hs.get_clock()
|
||||
self.database_engine = hs.database_engine
|
||||
|
||||
self.client_ip_last_seen = Cache(
|
||||
|
|
@ -173,6 +174,14 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||
prefilled_cache=push_rules_prefill,
|
||||
)
|
||||
|
||||
cur = db_conn.cursor()
|
||||
self._find_stream_orderings_for_times_txn(cur)
|
||||
cur.close()
|
||||
|
||||
self.find_stream_orderings_looping_call = self._clock.looping_call(
|
||||
self._find_stream_orderings_for_times, 60 * 60 * 1000
|
||||
)
|
||||
|
||||
super(DataStore, self).__init__(hs)
|
||||
|
||||
def take_presence_startup_info(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue