summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-07-03 09:31:27 +0100
committerGitHub <noreply@github.com>2019-07-03 09:31:27 +0100
commit91753cae5962a56ce0440b06891f1040ba7582e9 (patch)
tree8a2e5f3127b652f5b24ad877c0adb18612175d37 /synapse/storage/events.py
parentRemove SMTP_* env var functionality from docker conf (#5596) (diff)
downloadsynapse-91753cae5962a56ce0440b06891f1040ba7582e9.tar.xz
Fix a number of "Starting txn from sentinel context" warnings (#5605)
Fixes #5602, #5603
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index fefba39ea1..86f8485704 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -253,7 +253,14 @@ class EventsStore(
         )
 
         # Read the extrems every 60 minutes
-        hs.get_clock().looping_call(self._read_forward_extremities, 60 * 60 * 1000)
+        def read_forward_extremities():
+            # run as a background process to make sure that the database transactions
+            # have a logcontext to report to
+            return run_as_background_process(
+                "read_forward_extremities", self._read_forward_extremities
+            )
+
+        hs.get_clock().looping_call(read_forward_extremities, 60 * 60 * 1000)
 
     @defer.inlineCallbacks
     def _read_forward_extremities(self):