MCPcopy
hub / github.com/flyteorg/flyte / Update

Method Update

flytestdlib/cache/in_memory_auto_refresh.go:203–211  ·  view source on GitHub ↗

Update updates the item only if it exists in the cache, return true if we updated the item.

(id ItemID, item Item)

Source from the content-addressed store, hash-verified

201
202// Update updates the item only if it exists in the cache, return true if we updated the item.
203func (w *InMemoryAutoRefresh) Update(id ItemID, item Item) (ok bool) {
204 w.lock.Lock()
205 defer w.lock.Unlock()
206 ok = w.lruMap.Contains(id)
207 if ok {
208 w.lruMap.Add(id, item)
209 }
210 return ok
211}
212
213// Delete deletes the item from the cache if it exists.
214func (w *InMemoryAutoRefresh) Delete(key interface{}) {

Callers 1

syncMethod · 0.95

Calls 2

ContainsMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected