From 382b285e2f72f5ff1d4e19512e3443318fc581bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Thu, 5 Sep 2024 09:00:20 +0200 Subject: [PATCH] Invalidate sessions in the main thread (instead of goroutine) --- handlers/accesscontrol/access-control.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/handlers/accesscontrol/access-control.go b/handlers/accesscontrol/access-control.go index 3fde6d58..d99b4eb3 100644 --- a/handlers/accesscontrol/access-control.go +++ b/handlers/accesscontrol/access-control.go @@ -138,12 +138,11 @@ func (ac *AccessControlHandlersCollection) periodicRefreshIntervalCache(mapic mi refreshIntervalCache.mux.Unlock() ac.mutex.Unlock() - go func() { - glog.Infof("Invalidating sessions, count=%d", len(keysToInvalidate)) - for _, key := range keysToInvalidate { - mapic.InvalidateAllSessions(key) - } - }() + glog.Infof("Invalidating sessions, count=%d", len(keysToInvalidate)) + for _, key := range keysToInvalidate { + mapic.InvalidateAllSessions(key) + } + glog.Infof("Completed sessions invalidation, count=%d", len(keysToInvalidate)) } }() }