mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 07:34:48 -04:00
Fix instantiation of message retention purge jobs
When figuring out which topological token to start a purge job at, we need to do the following: 1. Figure out a timestamp before which events will be purged 2. Select the first stream ordering after that timestamp 3. Select info about the first event after that stream ordering 4. Build a topological token from that info In some situations (e.g. quiet rooms with a short max_lifetime), there might not be an event after the stream ordering at step 3, therefore we abort the purge with the error `No event found`. To mitigate that, this patch fetches the first event _before_ the stream ordering, instead of after.
This commit is contained in:
parent
b5ce7f5874
commit
855af069a4
2 changed files with 48 additions and 13 deletions
|
@ -156,7 +156,7 @@ class PaginationHandler(object):
|
|||
|
||||
stream_ordering = yield self.store.find_first_stream_ordering_after_ts(ts)
|
||||
|
||||
r = yield self.store.get_room_event_after_stream_ordering(
|
||||
r = yield self.store.get_room_event_before_stream_ordering(
|
||||
room_id, stream_ordering,
|
||||
)
|
||||
if not r:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue