Move logging utilities out of the side drawer of util/ and into logging/ (#5606)

This commit is contained in:
Amber Brown 2019-07-04 00:07:04 +10:00 committed by GitHub
parent cb8d568cf9
commit 463b072b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 249 additions and 233 deletions

View file

@ -23,13 +23,12 @@ from twisted.internet import defer
from twisted.internet.defer import CancelledError
from twisted.python import failure
from synapse.util import Clock, logcontext, unwrapFirstError
from .logcontext import (
from synapse.logging.context import (
PreserveLoggingContext,
make_deferred_yieldable,
run_in_background,
)
from synapse.util import Clock, unwrapFirstError
logger = logging.getLogger(__name__)
@ -153,7 +152,7 @@ def concurrently_execute(func, args, limit):
except StopIteration:
pass
return logcontext.make_deferred_yieldable(
return make_deferred_yieldable(
defer.gatherResults(
[run_in_background(_concurrently_execute_inner) for _ in range(limit)],
consumeErrors=True,
@ -174,7 +173,7 @@ def yieldable_gather_results(func, iter, *args, **kwargs):
Deferred[list]: Resolved when all functions have been invoked, or errors if
one of the function calls fails.
"""
return logcontext.make_deferred_yieldable(
return make_deferred_yieldable(
defer.gatherResults(
[run_in_background(func, item, *args, **kwargs) for item in iter],
consumeErrors=True,