-
Notifications
You must be signed in to change notification settings - Fork 40
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 Backlog Functionality #314
Conversation
PTAL |
req.Header.Set("User-Agent", userAgent) | ||
resp, err := qb.opt.HTTPClient.Do(req) | ||
if err != nil { | ||
logger.Printf("Backlog queue failed = %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog queue failed = %s", err) | |
logger.Errorf("Backlog queue failed = %s", err) |
} | ||
defer resp.Body.Close() | ||
if resp.StatusCode > 400 { | ||
logger.Printf("Backlog queue failed = %q", resp.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog queue failed = %q", resp.Status) | |
logger.Errorf("Backlog queue failed = %q", resp.Status) |
buf, | ||
) | ||
if err != nil { | ||
logger.Printf("Backlog queue failed = %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog queue failed = %s", err) | |
logger.Errorf("Backlog queue failed = %s", err) |
} | ||
defer resp.Body.Close() | ||
if resp.StatusCode > 400 { | ||
logger.Printf("Backlog notice failed = %q", resp.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog notice failed = %q", resp.Status) | |
logger.Errorf("Backlog notice failed = %q", resp.Status) |
req.Header.Set("User-Agent", userAgent) | ||
resp, err := nb.opt.HTTPClient.Do(req) | ||
if err != nil { | ||
logger.Printf("Backlog notice failed = %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog notice failed = %s", err) | |
logger.Errorf("Backlog notice failed = %s", err) |
} | ||
defer resp.Body.Close() | ||
if resp.StatusCode > 400 { | ||
logger.Printf("Backlog route stat failed = %q", resp.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Printf("Backlog route stat failed = %q", resp.Status) | |
logger.Errorf("Backlog route stat failed = %q", resp.Status) |
backlog.go
Outdated
|
||
// NewNoticeBacklog creates a new backlog for notices. | ||
func NewNoticeBacklog(opt *NotifierOptions) *noticeBacklog { | ||
if nb == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use once
, do we really need to wrap this in if nb == nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
PTAL |
dabbc77
to
3a8ade8
Compare
The Backlog class accepts notices and APM events and synchronously sends them in
the background at regular intervals (1 minute).
The notices that it accepts are those that have failed to be sent due to network
issues or Airbrake servers struggling. If the second attempt fails, then such
data is discarded forever.
The maximum backlog size is 100.