mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-02-25 06:39:46 -05:00
Do not rely on streaming events, as media repo doesn't
This commit is contained in:
parent
4e2a072a05
commit
187dc6ad02
@ -448,11 +448,22 @@ class RoomWorkerStore(SQLBaseStore):
|
|||||||
"""
|
"""
|
||||||
mxc_re = re.compile("^mxc://([^/]+)/([^/#?]+)")
|
mxc_re = re.compile("^mxc://([^/]+)/([^/#?]+)")
|
||||||
|
|
||||||
next_token = self.get_current_events_token() + 1
|
next_token = None
|
||||||
local_media_mxcs = []
|
local_media_mxcs = []
|
||||||
remote_media_mxcs = []
|
remote_media_mxcs = []
|
||||||
|
|
||||||
while next_token:
|
while True:
|
||||||
|
if next_token is None:
|
||||||
|
sql = """
|
||||||
|
SELECT stream_ordering, json FROM events
|
||||||
|
JOIN event_json USING (room_id, event_id)
|
||||||
|
WHERE room_id = ?
|
||||||
|
AND contains_url = ? AND outlier = ?
|
||||||
|
ORDER BY stream_ordering DESC
|
||||||
|
LIMIT ?
|
||||||
|
"""
|
||||||
|
txn.execute(sql, (room_id, True, False, 100))
|
||||||
|
else:
|
||||||
sql = """
|
sql = """
|
||||||
SELECT stream_ordering, json FROM events
|
SELECT stream_ordering, json FROM events
|
||||||
JOIN event_json USING (room_id, event_id)
|
JOIN event_json USING (room_id, event_id)
|
||||||
@ -484,6 +495,9 @@ class RoomWorkerStore(SQLBaseStore):
|
|||||||
else:
|
else:
|
||||||
remote_media_mxcs.append((hostname, media_id))
|
remote_media_mxcs.append((hostname, media_id))
|
||||||
|
|
||||||
|
if next_token is None:
|
||||||
|
break
|
||||||
|
|
||||||
return local_media_mxcs, remote_media_mxcs
|
return local_media_mxcs, remote_media_mxcs
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user