summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-15 09:45:44 +0100
committerErik Johnston <erik@matrix.org>2016-08-15 09:45:44 +0100
commit99bbd90b0da01690bd1193898138c64008ed71ad (patch)
tree41d4968192cfd3ea42bef5ca904ef183671dc6e6 /synapse/storage
parentMake synchrotron accept /events (diff)
downloadsynapse-99bbd90b0da01690bd1193898138c64008ed71ad.tar.xz
Always run txn.after_callbacks
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/_base.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 0117fdc639..e516b6de3e 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -305,13 +305,14 @@ class SQLBaseStore(object):
                     func, *args, **kwargs
                 )
 
-        with PreserveLoggingContext():
-            result = yield self._db_pool.runWithConnection(
-                inner_func, *args, **kwargs
-            )
-
-        for after_callback, after_args in after_callbacks:
-            after_callback(*after_args)
+        try:
+            with PreserveLoggingContext():
+                result = yield self._db_pool.runWithConnection(
+                    inner_func, *args, **kwargs
+                )
+        finally:
+            for after_callback, after_args in after_callbacks:
+                after_callback(*after_args)
         defer.returnValue(result)
 
     @defer.inlineCallbacks