From 120a2be8dafd9ab4e896da413f7797ed2ead0c0c Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Wed, 30 Aug 2023 11:36:12 +0100 Subject: [PATCH] Create a new context for each WSGI request --- bugsnag/wsgi/middleware.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bugsnag/wsgi/middleware.py b/bugsnag/wsgi/middleware.py index c215523c..45579314 100644 --- a/bugsnag/wsgi/middleware.py +++ b/bugsnag/wsgi/middleware.py @@ -3,6 +3,7 @@ from typing import Dict import bugsnag +from bugsnag.context import create_new_context from bugsnag.wsgi import request_path from bugsnag.breadcrumbs import BreadcrumbType from bugsnag.legacy import _auto_leave_breadcrumb @@ -59,6 +60,8 @@ def __init__(self, application, environ, start_response): self.environ = environ bugsnag.configure_request(wsgi_environ=self.environ) + create_new_context() + try: if bugsnag.configuration.auto_capture_sessions: bugsnag.start_session()