-
Notifications
You must be signed in to change notification settings - Fork 245
Implement flush with context #935
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f9bcfff
implement flush with context
ribice cc9bea5
re-add comment
ribice 72dd675
add flushwithcontext methods on hub, client and global
ribice cfd36cc
update readme
ribice a88eb2c
add FlushWithContext to SyncTransport
ribice 43ad673
add FlushWithContext to logrus
ribice c35e98e
fix tests
ribice 3f8bf08
simplify flush
ribice f73ddb5
Merge branch 'master' into flush-with-ctx
ribice 60a79dc
Merge branch 'master' into flush-with-ctx
cleptric 3fb90ca
fix changelog conflicts
ribice c3b4932
fix logrus
ribice d8eb25f
add example
ribice a94845b
add example
ribice 9330f8c
Update CHANGELOG.md
ribice 951d84b
Merge remote-tracking branch 'origin/master' into flush-with-ctx
giortzisg f8611db
add FlushWithContext tests
giortzisg 424fe5e
defer cancel calls
giortzisg 20577d0
improve coverage
giortzisg 4310db4
Merge branch 'master' into flush-with-ctx
cleptric a0ea423
add nil client tests
giortzisg 57cfd59
lint changes
giortzisg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "time" | ||
|
|
||
| "github.com/getsentry/sentry-go" | ||
| ) | ||
|
|
||
| func main() { | ||
| _ = sentry.Init(sentry.ClientOptions{ | ||
| Dsn: "https://hello@example.com/1337", | ||
| Debug: true, | ||
| }) | ||
|
|
||
| sentry.CaptureMessage("Event #1") | ||
| sentry.CaptureMessage("Event #2") | ||
| sentry.CaptureMessage("Event #3") | ||
|
|
||
| go func() { | ||
| sentry.CaptureMessage("Event #4") | ||
| sentry.CaptureMessage("Event #5") | ||
| }() | ||
|
|
||
| fmt.Println("=> Flushing transport buffer") | ||
|
|
||
| ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) | ||
| defer cancel() | ||
|
|
||
| if sentry.FlushWithContext(ctx) { | ||
| fmt.Println("=> All queued events delivered!") | ||
| } else { | ||
| fmt.Println("=> Flush timeout reached") | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.