mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-10-19 01:27:31 +00:00
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.
This commit is contained in:
@@ -117,6 +117,14 @@ func (vc *ValidationCache) Size() int {
|
|||||||
return len(vc.cache)
|
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
|
// cleanupExpired removes expired entries periodically. Exits when Stop is
|
||||||
// called.
|
// called.
|
||||||
func (vc *ValidationCache) cleanupExpired() {
|
func (vc *ValidationCache) cleanupExpired() {
|
||||||
|
|||||||
Reference in New Issue
Block a user