Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flush method that waits for in-flight requests #377

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Conversation

imjoehaines
Copy link
Contributor

@imjoehaines imjoehaines commented Mar 28, 2024

Goal

This allows users to wait for any outstanding bugsnag requests to finish before exiting, e.g.:

client = Client()
client.notify(some_exception)
client.session_tracker.start_session()

# some time later

try:
    client.flush(timeout_ms=2000)  # timeout after 2 seconds
    # the event & session have both been delivered
except:
    pass  # timeout was exceeded

sys.exit()

@imjoehaines imjoehaines merged commit d2ca37f into next Mar 28, 2024
20 checks passed
@imjoehaines imjoehaines deleted the client-flush branch March 28, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants