mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 03:20:52 +00:00
Fix event-purge-by-ts admin API
This got completely broken in 0.30. Fixes #3300.
This commit is contained in:
parent
48e2b48888
commit
0546715c18
1 changed files with 4 additions and 6 deletions
|
@ -169,16 +169,12 @@ class PurgeHistoryRestServlet(ClientV1RestServlet):
|
||||||
yield self.store.find_first_stream_ordering_after_ts(ts)
|
yield self.store.find_first_stream_ordering_after_ts(ts)
|
||||||
)
|
)
|
||||||
|
|
||||||
room_event_after_stream_ordering = (
|
r = (
|
||||||
yield self.store.get_room_event_after_stream_ordering(
|
yield self.store.get_room_event_after_stream_ordering(
|
||||||
room_id, stream_ordering,
|
room_id, stream_ordering,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if room_event_after_stream_ordering:
|
if not r:
|
||||||
token = yield self.store.get_topological_token_for_event(
|
|
||||||
room_event_after_stream_ordering,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"[purge] purging events not possible: No event found "
|
"[purge] purging events not possible: No event found "
|
||||||
"(received_ts %i => stream_ordering %i)",
|
"(received_ts %i => stream_ordering %i)",
|
||||||
|
@ -189,6 +185,8 @@ class PurgeHistoryRestServlet(ClientV1RestServlet):
|
||||||
"there is no event to be purged",
|
"there is no event to be purged",
|
||||||
errcode=Codes.NOT_FOUND,
|
errcode=Codes.NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
(stream, topo, _event_id) = r
|
||||||
|
token = "t%d-%d" % (topo, stream)
|
||||||
logger.info(
|
logger.info(
|
||||||
"[purge] purging up to token %d (received_ts %i => "
|
"[purge] purging up to token %d (received_ts %i => "
|
||||||
"stream_ordering %i)",
|
"stream_ordering %i)",
|
||||||
|
|
Loading…
Reference in a new issue