MCPcopy
hub / github.com/argoproj/argo-workflows / GetCache

Method GetCache

workflow/controller/cache/cache.go:79–104  ·  view source on GitHub ↗

Returns a cache if it exists and creates it otherwise

(ct CacheType, name string)

Source from the content-addressed store, hash-verified

77
78// Returns a cache if it exists and creates it otherwise
79func (cf *cacheFactory) GetCache(ct CacheType, name string) MemoizationCache {
80 cf.lock.RLock()
81
82 idx := string(ct) + "." + name
83 if c := cf.caches[idx]; c != nil {
84 cf.lock.RUnlock()
85 return c
86 }
87 cf.lock.RUnlock()
88
89 cf.lock.Lock()
90 defer cf.lock.Unlock()
91
92 if c := cf.caches[idx]; c != nil {
93 return c
94 }
95
96 switch ct {
97 case ConfigMapCache:
98 c := NewConfigMapCache(cf.namespace, cf.kubeclient, name)
99 cf.caches[idx] = c
100 return c
101 default:
102 return nil
103 }
104}

Callers

nothing calls this directly

Calls 1

NewConfigMapCacheFunction · 0.85

Tested by

no test coverage detected