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

setNoticeBacklog meant to never terminate? #378

Open
bchemel opened this issue Apr 17, 2023 · 0 comments
Open

setNoticeBacklog meant to never terminate? #378

bchemel opened this issue Apr 17, 2023 · 0 comments

Comments

@bchemel
Copy link

bchemel commented Apr 17, 2023

Hello! I'm chasing down a problem in some remotely-deployed embedded engine code that uses gobrake to upload errors to airbrake. I'm not sure that it's related to our problem, but I just started a dive into the backlog capabilities added in v5.6.0 and the following code caught my eye - is this for loop intended to loop forever? I would (naively) expect it to wait for the backlog period, flush, and then exit.

Thank you!
Brian

// setNoticeBacklog sets new backlog notice.
func setNoticeBacklog(notice *Notice) {
	if nb.opt.DisableBacklog {
		return
	}
	if len(nb.notices) < nb.maxLength {
		nb.notices = append(nb.notices, *notice)
	}
	for {
		<-time.After(flushBacklogPeriod)
		nb.flushNoticeBacklog()
	}
}
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

No branches or pull requests

1 participant