Fix a number of "Starting txn from sentinel context" warnings (#5605)

Fixes #5602, #5603
This commit is contained in:
Richard van der Hoff 2019-07-03 09:31:27 +01:00 committed by GitHub
parent c7b48bd42d
commit 91753cae59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 6 deletions

View file

@ -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):