Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c003984

Browse filesBrowse files
gravelgcarlosalberto
authored andcommitted
Add default to _after_request_fn (#6)
1 parent fcf20ad commit c003984
Copy full SHA for c003984

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎flask_opentracing/tracer.py

Copy file name to clipboardExpand all lines: flask_opentracing/tracer.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def _before_request_fn(self, attributes):
9292

9393
def _after_request_fn(self):
9494
request = stack.top.request
95-
span = self._current_spans.pop(request)
95+
# the pop call can fail if the request is interrupted by a `before_request` method so we need a default
96+
span = self._current_spans.pop(request, None)
9697
if span is not None:
9798
span.finish()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.