MCPcopy Create free account
hub / github.com/PostHog/duckgres / evictOldest

Method evictOldest

cmd/cache-proxy/cache.go:346–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344 for element := dc.order.Front(); element != nil; element = element.Next() {
345 if rehashed%startupScanChunkSize == 0 {
346 if option.summaryRehashHook != nil {
347 option.summaryRehashHook(rehashed)
348 }
349 if err := startupContext.Err(); err != nil {
350 return nil, fmt.Errorf("rebuild startup Bloom summary: %w", err)
351 }
352 }
353 dc.summary.Add(element.Value.(*cacheEntry).key)
354 rehashed++
355 }
356 }
357
358 if option.DurableRecency {
359 dc.recency = newRecencyWriter(dir, option.recencyQueueCapacity, option.recencyWorkerCount, option.recencyChtimes)
360 }
361 if option.convergencePermits != nil || option.BackgroundConvergence {
362 dc.startConvergence(startupContext, option.convergencePermits, option.convergenceInterval)
363 }
364
365 slog.Info("Cache initialized.",
366 "dir", dir,

Callers 2

PutMethod · 0.95
PutStreamMethod · 0.95

Calls 1

RemoveMethod · 0.80

Tested by

no test coverage detected