From 8112b4859f2ce13a44d5486a6ccbfdc6c91611b8 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 2 Oct 2026 13:23:58 +0100 Subject: [PATCH] fix(auth): restore ValidationCache.Stop Stop was deleted while its field and doc comment stayed. The cleanup goroutine could not be stopped, and staticcheck flagged stopOnce as unused. --- pkg/auth/validation_cache.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/auth/validation_cache.go b/pkg/auth/validation_cache.go index ad0886d..95e8563 100644 --- a/pkg/auth/validation_cache.go +++ b/pkg/auth/validation_cache.go @@ -117,6 +117,14 @@ func (vc *ValidationCache) Size() int { return len(vc.cache) } +// Stop terminates the background cleanup goroutine. Safe to call multiple +// times; subsequent calls are no-ops. +func (vc *ValidationCache) Stop() { + vc.stopOnce.Do(func() { + close(vc.stopCh) + }) +} + // cleanupExpired removes expired entries periodically. Exits when Stop is // called. func (vc *ValidationCache) cleanupExpired() {