bugsnag / bugsnag-python

Official BugSnag error monitoring and error reporting for django, flask, tornado and other python apps.
https://docs.bugsnag.com/platforms/python/
MIT License
84 stars 42 forks source link

Ensure sessions are sent at exit #371

Closed imjoehaines closed 6 months ago

imjoehaines commented 7 months ago

Goal

We use an atexit hook to deliver any outstanding sessions when the process exits, but this delivery happens asynchronously and therefore isn't guaranteed to finish

This PR adds an options parameter to deliver_sessions (matching deliver) that allows forcing synchronous delivery and then uses this to send sessions synchronously at exit