MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / cleanupLoop

Method cleanupLoop

internal/sessions/manager.go:396–407  ·  view source on GitHub ↗

cleanupLoop periodically removes expired sessions.

()

Source from the content-addressed store, hash-verified

394
395// cleanupLoop periodically removes expired sessions.
396func (m *Manager) cleanupLoop() {
397 ticker := time.NewTicker(cleanupInterval)
398 defer ticker.Stop()
399 for {
400 select {
401 case <-ticker.C:
402 m.cleanup()
403 case <-m.stopCh:
404 return
405 }
406 }
407}
408
409func (m *Manager) cleanup() {
410 cutoff := time.Now().Add(-m.expiry)

Callers 1

GlobalFunction · 0.95

Calls 2

cleanupMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected