Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix event-purge-by-ts admin API
Browse files Browse the repository at this point in the history
This got completely broken in 0.30.

Fixes #3300.
  • Loading branch information
richvdh committed Jun 6, 2018
1 parent 48e2b48 commit 0546715
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions synapse/rest/client/v1/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,12 @@ def on_POST(self, request, room_id, event_id):
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(
room_id, stream_ordering,
)
)
if room_event_after_stream_ordering:
token = yield self.store.get_topological_token_for_event(
room_event_after_stream_ordering,
)
else:
if not r:
logger.warn(
"[purge] purging events not possible: No event found "
"(received_ts %i => stream_ordering %i)",
Expand All @@ -189,6 +185,8 @@ def on_POST(self, request, room_id, event_id):
"there is no event to be purged",
errcode=Codes.NOT_FOUND,
)
(stream, topo, _event_id) = r
token = "t%d-%d" % (topo, stream)
logger.info(
"[purge] purging up to token %d (received_ts %i => "
"stream_ordering %i)",
Expand Down

0 comments on commit 0546715

Please sign in to comment.