summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-04 15:21:29 +0100
committerErik Johnston <erik@matrix.org>2016-08-04 15:21:29 +0100
commit8ad8490cff9002bc8928c06edab89f813a303cc4 (patch)
tree11ae8ef885d2d6e1e3c73a492305b1c7dd6942d3
parentRetry event persistence on IntegrityError (diff)
downloadsynapse-8ad8490cff9002bc8928c06edab89f813a303cc4.tar.xz
Fix typo
-rw-r--r--synapse/storage/events.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 468a259a6a..340c0621cc 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -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
 
@@ -577,6 +576,8 @@ class EventsStore(SQLBaseStore):
             # This gets around any problems with some tables already having
             # entries.
 
+            logger.info("Deleting existing")
+
             for table in (
                 "events",
                 "event_json",
@@ -595,7 +596,7 @@ class EventsStore(SQLBaseStore):
             ):
                 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(