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

Simplify API for flushing events #2030

Merged
merged 11 commits into from
Nov 4, 2022
Merged

Simplify API for flushing events #2030

merged 11 commits into from
Nov 4, 2022

Conversation

mattjohnsonpint
Copy link
Contributor

@mattjohnsonpint mattjohnsonpint commented Nov 3, 2022

This is mostly just for convenience, simplifying usage and documentation.

  • Move the FlushTimeout option to SentryOptions.

    • Previously this was defined separately on SentryAspNetCoreOptions and SentryNLogOptions only.
    • Note, this is not a breaking change, as those classes inherit from SentryOptions already.
    • We default to 2 seconds, except for NLog where we preserve the existing 15 second default.
  • Add FlushAsync() APIs where we previously had FlushAsync(timeout).

    • When a timeout is not specified, the value from the FlushTimeout option is used.
  • Added synchronous versions, Flush() and Flush(timeout). They are blocking sync-over-async, but that's what we've been doing already anyway. This reduces error and gets .Wait() or .GetAwaiter().GetResult() out of samples and docs.

  • Updated existing usages throughout the solution

  • Added tests

@mattjohnsonpint mattjohnsonpint merged commit 57feab3 into main Nov 4, 2022
@mattjohnsonpint mattjohnsonpint deleted the add-flush-overloads branch November 4, 2022 17:37
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