Skip to content

Commit

Permalink
Add logging to the session refresh (#3083)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Jun 21, 2024
1 parent 20e81fb commit 3dcdf3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ func (sp *SessionPool) selectSessions(ctx context.Context, sessionsNum int) []*B

checkSessions := func(m *SessionPool) bool {
numSess := m.sel.Size()
if numSess < int(math.Min(maxRefreshSessionsThreshold, math.Ceil(float64(m.numOrchs)/2.0))) {
refreshThreshold := int(math.Min(maxRefreshSessionsThreshold, math.Ceil(float64(m.numOrchs)/2.0)))
clog.Infof(ctx, "Checking if the session refresh is needed, numSess=%v, refreshThreshold=%v", numSess, refreshThreshold)
if numSess < refreshThreshold {
go m.refreshSessions(ctx)
}
return (numSess > 0 || len(sp.lastSess) > 0)
Expand Down

0 comments on commit 3dcdf3d

Please sign in to comment.