mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge pull request #3160 from krombel/fix_3076
add guard for None on purge_history api
This commit is contained in:
commit
cead75fae3
@ -168,11 +168,24 @@ class PurgeHistoryRestServlet(ClientV1RestServlet):
|
|||||||
yield self.store.find_first_stream_ordering_after_ts(ts)
|
yield self.store.find_first_stream_ordering_after_ts(ts)
|
||||||
)
|
)
|
||||||
|
|
||||||
(_, depth, _) = (
|
room_event_after_stream_ordering = (
|
||||||
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:
|
||||||
|
(_, depth, _) = room_event_after_stream_ordering
|
||||||
|
else:
|
||||||
|
logger.warn(
|
||||||
|
"[purge] purging events not possible: No event found "
|
||||||
|
"(received_ts %i => stream_ordering %i)",
|
||||||
|
ts, stream_ordering,
|
||||||
|
)
|
||||||
|
raise SynapseError(
|
||||||
|
404,
|
||||||
|
"there is no event to be purged",
|
||||||
|
errcode=Codes.NOT_FOUND,
|
||||||
|
)
|
||||||
logger.info(
|
logger.info(
|
||||||
"[purge] purging up to depth %i (received_ts %i => "
|
"[purge] purging up to depth %i (received_ts %i => "
|
||||||
"stream_ordering %i)",
|
"stream_ordering %i)",
|
||||||
|
Loading…
Reference in New Issue
Block a user