Skip to content

Commit

Permalink
Log "Invalidating sessions" only when count > 0
Browse files Browse the repository at this point in the history
There were too many "Invalidating sessions" logs
  • Loading branch information
leszko committed Sep 5, 2024
1 parent 382b285 commit 6cfd53b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions handlers/accesscontrol/access-control.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ func (ac *AccessControlHandlersCollection) periodicRefreshIntervalCache(mapic mi
refreshIntervalCache.mux.Unlock()
ac.mutex.Unlock()

glog.Infof("Invalidating sessions, count=%d", len(keysToInvalidate))
for _, key := range keysToInvalidate {
mapic.InvalidateAllSessions(key)
if len(keysToInvalidate) > 0 {
glog.Infof("Invalidating sessions, count=%d", len(keysToInvalidate))
for _, key := range keysToInvalidate {
mapic.InvalidateAllSessions(key)
}
glog.Infof("Completed sessions invalidation, count=%d", len(keysToInvalidate))
}
glog.Infof("Completed sessions invalidation, count=%d", len(keysToInvalidate))
}
}()
}
Expand Down

0 comments on commit 6cfd53b

Please sign in to comment.