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

Function getOrCreateGroupCache

internal/cache/signature_cache.go:67–77  ·  view source on GitHub ↗

getOrCreateGroupCache gets or creates a cache bucket for a model group

(groupKey string)

Source from the content-addressed store, hash-verified

65
66// getOrCreateGroupCache gets or creates a cache bucket for a model group
67func getOrCreateGroupCache(groupKey string) *groupCache {
68 // Start background cleanup on first access
69 cacheCleanupOnce.Do(startCacheCleanup)
70
71 if val, ok := signatureCache.Load(groupKey); ok {
72 return val.(*groupCache)
73 }
74 sc := &groupCache{entries: make(map[string]SignatureEntry)}
75 actual, _ := signatureCache.LoadOrStore(groupKey, sc)
76 return actual.(*groupCache)
77}
78
79// startCacheCleanup launches a background goroutine that periodically
80// removes caches where all entries have expired.

Callers 1

CacheSignatureBestEffortFunction · 0.85

Calls 2

DoMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected