Skip to content

Commit 24be3d3

Browse files
committed
.
1 parent a614fc6 commit 24be3d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry_sdk/integrations/wsgi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ def __iter__(self):
264264
try:
265265
chunk = next(iterator)
266266
except StopIteration:
267+
# Close the Sentry transaction (it could be that response.close() is never called by the framework)
268+
# This is done here to make sure the Transaction stays
269+
# open until all streaming responses are done.
270+
finish_running_transaction(self._current_scope)
267271
break
268272
except BaseException:
269273
reraise(*_capture_exception())

0 commit comments

Comments
 (0)