We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e626639 + 791d9d1 commit 45d9c21Copy full SHA for 45d9c21
packages/service-library/src/servicelib/tracing.py
@@ -21,13 +21,14 @@ def get_context() -> TracingContext:
21
22
@contextmanager
23
def use_tracing_context(context: TracingContext):
24
+ token: object | None = None
25
if context is not None:
- otcontext.attach(context)
26
+ token = otcontext.attach(context)
27
try:
28
yield
29
finally:
- if context is not None:
30
- otcontext.detach(context)
+ if token is not None:
31
+ otcontext.detach(token)
32
33
34
def setup_log_tracing(tracing_settings: TracingSettings):
0 commit comments