summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-05-12 15:23:50 +0100
committerMark Haines <mjark@negativecurvature.net>2015-05-12 15:23:50 +0100
commita6fb2aa2a5a5837d77bed8813f9e59bfe6be8999 (patch)
tree154ff4598b9740104abd5cf465c98cf2797c5406 /synapse/storage
parentMerge pull request #149 from matrix-org/erikj/backfill (diff)
parentMake distributer.fire work as it did (diff)
downloadsynapse-a6fb2aa2a5a5837d77bed8813f9e59bfe6be8999.tar.xz
Merge pull request #144 from matrix-org/erikj/logging_context
Preserving logging contexts
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/_base.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 9e348590ba..c9fe5a3555 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -18,7 +18,7 @@ from synapse.api.errors import StoreError
 from synapse.events import FrozenEvent
 from synapse.events.utils import prune_event
 from synapse.util.logutils import log_function
-from synapse.util.logcontext import PreserveLoggingContext, LoggingContext
+from synapse.util.logcontext import preserve_context_over_fn, LoggingContext
 from synapse.util.lrucache import LruCache
 import synapse.metrics
 
@@ -420,10 +420,11 @@ class SQLBaseStore(object):
                     self._txn_perf_counters.update(desc, start, end)
                     sql_txn_timer.inc_by(duration, desc)
 
-        with PreserveLoggingContext():
-            result = yield self._db_pool.runWithConnection(
-                inner_func, *args, **kwargs
-            )
+        result = yield preserve_context_over_fn(
+            self._db_pool.runWithConnection,
+            inner_func, *args, **kwargs
+        )
+
         for after_callback, after_args in after_callbacks:
             after_callback(*after_args)
         defer.returnValue(result)