mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 20:24:32 +03:00
Nicer use of dict update methods.
This commit is contained in:
parent
46e41ee08d
commit
d859c34fb9
1 changed files with 3 additions and 8 deletions
|
@ -232,14 +232,9 @@ class PerDestinationQueue(object):
|
|||
# If there is no span context then we are either blacklisting
|
||||
# this destination or we are not tracing
|
||||
if span_context:
|
||||
if "references" not in span_context:
|
||||
span_context["references"] = [
|
||||
opentracing.active_span_context_as_string()
|
||||
]
|
||||
else:
|
||||
span_context["references"].append(
|
||||
opentracing.active_span_context_as_string()
|
||||
)
|
||||
span_context.setdefault("references", []).append(
|
||||
opentracing.active_span_context_as_string()
|
||||
)
|
||||
edu_dict["content"]["context"] = json.dumps(
|
||||
{"opentracing": span_context}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue