getOrCreateGroupCache gets or creates a cache bucket for a model group
(groupKey string)
| 65 | |
| 66 | // getOrCreateGroupCache gets or creates a cache bucket for a model group |
| 67 | func 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. |
no test coverage detected