MCPcopy
hub / github.com/usememos/memos / cleanupLoop

Method cleanupLoop

store/cache/cache.go:200–215  ·  view source on GitHub ↗

cleanupLoop periodically cleans up expired items.

()

Source from the content-addressed store, hash-verified

198
199// cleanupLoop periodically cleans up expired items.
200func (c *Cache) cleanupLoop() {
201 ticker := time.NewTicker(c.config.CleanupInterval)
202 defer func() {
203 ticker.Stop()
204 close(c.closedChan)
205 }()
206
207 for {
208 select {
209 case <-ticker.C:
210 c.cleanup()
211 case <-c.stopChan:
212 return
213 }
214 }
215}
216
217// cleanup removes expired items.
218func (c *Cache) cleanup() {

Callers 1

NewFunction · 0.95

Calls 2

cleanupMethod · 0.95
StopMethod · 0.45

Tested by

no test coverage detected