MCPcopy
hub / github.com/redis/go-redis / cleanupLoop

Method cleanupLoop

maintnotifications/circuit_breaker.go:280–292  ·  view source on GitHub ↗

cleanupLoop runs background cleanup of unused circuit breakers

()

Source from the content-addressed store, hash-verified

278
279// cleanupLoop runs background cleanup of unused circuit breakers
280func (cbm *CircuitBreakerManager) cleanupLoop() {
281 ticker := time.NewTicker(5 * time.Minute) // Cleanup every 5 minutes
282 defer ticker.Stop()
283
284 for {
285 select {
286 case <-ticker.C:
287 cbm.cleanup()
288 case <-cbm.cleanupStop:
289 return
290 }
291 }
292}
293
294// cleanup removes circuit breakers that haven't been accessed recently
295func (cbm *CircuitBreakerManager) cleanup() {

Callers 1

newCircuitBreakerManagerFunction · 0.95

Calls 2

cleanupMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected