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

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Aug 4, 2016
1 parent 59fa91f commit 8ad8490
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,10 @@ def _retry_on_integrity_error(func):
def f(self, *args, **kwargs):
try:
res = yield func(self, *args, **kwargs)
defer.returnValue(res)
except self.database_engine.module.IntegrityError:
logger.exception("IntegrityError, retrying.")
res = yield func(self, *args, delete_existing=True, **kwargs)
defer.returnValue(res)
defer.returnValue(res)

return f

Expand Down Expand Up @@ -577,6 +576,8 @@ def event_dict(event):
# This gets around any problems with some tables already having
# entries.

logger.info("Deleting existing")

for table in (
"events",
"event_json",
Expand All @@ -595,7 +596,7 @@ def event_dict(event):
):
txn.executemany(
"DELETE FROM %s WHERE event_id = ?" % (table,),
[ev for ev, _ in events_and_contexts]
[(ev.event_id,) for ev, _ in events_and_contexts]
)

self._simple_insert_many_txn(
Expand Down

0 comments on commit 8ad8490

Please sign in to comment.