Merge pull request #3140 from matrix-org/rav/use_run_in_background

Use run_in_background in preference to preserve_fn
This commit is contained in:
Richard van der Hoff 2018-04-30 00:34:28 +01:00 committed by GitHub
commit aab2e4da60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 98 additions and 72 deletions

View file

@ -19,7 +19,7 @@ from twisted.internet.defer import CancelledError
from twisted.python import failure
from .logcontext import (
PreserveLoggingContext, make_deferred_yieldable, preserve_fn
PreserveLoggingContext, make_deferred_yieldable, run_in_background
)
from synapse.util import logcontext, unwrapFirstError
@ -163,7 +163,7 @@ def concurrently_execute(func, args, limit):
pass
return logcontext.make_deferred_yieldable(defer.gatherResults([
preserve_fn(_concurrently_execute_inner)()
run_in_background(_concurrently_execute_inner)
for _ in xrange(limit)
], consumeErrors=True)).addErrback(unwrapFirstError)