Skip to content

setNoticeBacklog meant to never terminate? #378

@bchemel

Description

@bchemel

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()
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions