summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-01-10 15:11:27 +0000
committerErik Johnston <erik@matrix.org>2017-01-10 15:11:27 +0000
commit5a32e9273ec9759caf09d5b8204dd29e7a007b97 (patch)
tree3f471029a1c13821fc519289a422c2a885d8c095 /synapse/storage
parentChange device_inbox stream index to include user (diff)
downloadsynapse-5a32e9273ec9759caf09d5b8204dd29e7a007b97.tar.xz
Don't disable autocommit
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/deviceinbox.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/synapse/storage/deviceinbox.py b/synapse/storage/deviceinbox.py
index b71ac3ae39..b0ab70bafe 100644
--- a/synapse/storage/deviceinbox.py
+++ b/synapse/storage/deviceinbox.py
@@ -388,14 +388,10 @@ class DeviceInboxStore(BackgroundUpdateStore):
     @defer.inlineCallbacks
     def _background_drop_index_device_inbox(self, progress, batch_size):
         def reindex_txn(conn):
-            conn.set_session(autocommit=True)
-            try:
-                txn = conn.cursor()
-                txn.execute(
-                    "DROP INDEX IF EXISTS device_inbox_stream_id"
-                )
-            finally:
-                conn.set_session(autocommit=False)
+            txn = conn.cursor()
+            txn.execute(
+                "DROP INDEX IF EXISTS device_inbox_stream_id"
+            )
 
         yield self.runWithConnection(reindex_txn)