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

Commit

Permalink
Merge pull request #985 from matrix-org/erikj/fix_integrity_retry
Browse files Browse the repository at this point in the history
Tweak integrity error recovery to work as intended
  • Loading branch information
erikjohnston authored Aug 5, 2016
2 parents a5d7968 + f0fa66f commit 87ef315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def get_state_for_room(self, destination, room_id, event_id):

defer.returnValue((pdus, auth_chain))
except HttpResponseException as e:
if e.code == 404:
if e.code == 400 or e.code == 404:
logger.info("Failed to use get_room_state_ids API, falling back")
else:
raise e
Expand Down
8 changes: 8 additions & 0 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ def event_dict(event):

for table in (
"events",
"event_auth",
"event_json",
"event_content_hashes",
"event_destinations",
Expand All @@ -591,8 +592,15 @@ def event_dict(event):
"event_search",
"event_signatures",
"event_to_state_groups",
"guest_access",
"history_visibility",
"local_invites",
"room_names",
"state_events",
"rejections",
"redactions",
"room_memberships",
"state_events"
):
txn.executemany(
"DELETE FROM %s WHERE event_id = ?" % (table,),
Expand Down

0 comments on commit 87ef315

Please sign in to comment.