diff options
author | Jorik Schellekens <joriks@matrix.org> | 2019-08-05 12:16:10 +0100 |
---|---|---|
committer | Jorik Schellekens <joriks@matrix.org> | 2019-08-05 12:16:10 +0100 |
commit | d859c34fb9b6387f773380ba1d58c5d449b912f4 (patch) | |
tree | a017269feec8b2ba381108d3791c348364f3a55d | |
parent | Comment for 'context' column in device_lists_outbound_pokes' (diff) | |
download | synapse-d859c34fb9b6387f773380ba1d58c5d449b912f4.tar.xz |
Nicer use of dict update methods.
-rw-r--r-- | synapse/federation/sender/per_destination_queue.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/synapse/federation/sender/per_destination_queue.py b/synapse/federation/sender/per_destination_queue.py index 2cba9d191e..0d7246a613 100644 --- a/synapse/federation/sender/per_destination_queue.py +++ b/synapse/federation/sender/per_destination_queue.py @@ -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} ) |