Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Nov 19, 2024
1 parent 54cda52 commit d904f38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _request_started(app, **kwargs):


def _request_finished(sender, response, **kwargs):
# Manually close the transaction because Bottle does not call `close()` on the WSGI response
# Manually close the transaction because Flask does not call `close()` on the WSGI response
finish_running_transaction()


Expand Down
6 changes: 4 additions & 2 deletions sentry_sdk/tracing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,5 +729,7 @@ def get_current_span(scope=None):
def finish_running_transaction():
# type: () -> None
current_scope = sentry_sdk.get_current_scope()
if current_scope._transaction is not None and hasattr(current_scope._transaction, "_context_manager_state"):
current_scope._transaction.__exit__(None, None, None)
if current_scope.transaction is not None and hasattr(
current_scope.transaction, "_context_manager_state"
):
current_scope.transaction.__exit__(None, None, None)

0 comments on commit d904f38

Please sign in to comment.