Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/sample-apps/flask/requests-…
Browse files Browse the repository at this point in the history
…2.32.0
  • Loading branch information
wangzlei authored Jun 4, 2024
2 parents 4f4349b + 1ea7768 commit 6a4f7f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aws_xray_sdk/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ def end_subsegment(self, end_time=None):
:param float end_time: epoch in seconds. If not specified the current
system time will be used.
"""
subsegment = self.get_trace_entity()
if self._is_subsegment(subsegment):
subsegment.close(end_time)
entity = self.get_trace_entity()
if self._is_subsegment(entity):
entity.close(end_time)
self._local.entities.pop()
return True
elif isinstance(entity, DummySegment):
return False
else:
log.warning("No subsegment to end.")
return False
Expand Down

0 comments on commit 6a4f7f4

Please sign in to comment.