diff options
author | Erik Johnston <erik@matrix.org> | 2016-08-15 09:45:44 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-08-15 09:45:44 +0100 |
commit | 99bbd90b0da01690bd1193898138c64008ed71ad (patch) | |
tree | 41d4968192cfd3ea42bef5ca904ef183671dc6e6 /synapse | |
parent | Make synchrotron accept /events (diff) | |
download | synapse-99bbd90b0da01690bd1193898138c64008ed71ad.tar.xz |
Always run txn.after_callbacks
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/_base.py | 15 |
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 |