MCPcopy Create free account
hub / github.com/github/gh-aw / Delete

Method Delete

pkg/workflow/action_cache.go:328–354  ·  view source on GitHub ↗

Delete removes the cache entry for the given repo and version. It first tries the canonical formatted key, then falls back to scanning all entries for a matching repo+version pair to handle key/version mismatches. It is a no-op if no matching entry is found.

(repo, version string)

Source from the content-addressed store, hash-verified

326// entries for a matching repo+version pair to handle key/version mismatches.
327// It is a no-op if no matching entry is found.
328func (c *ActionCache) Delete(repo, version string) {
329 key := formatActionCacheKey(repo, version)
330
331 deleted := false
332
333 // First, try deleting by the canonical formatted key.
334 if _, exists := c.Entries[key]; exists {
335 delete(c.Entries, key)
336 deleted = true
337 actionCacheLog.Printf("Deleted cache entry: key=%s", key)
338 }
339
340 // Also delete any entries whose stored fields match repo and version,
341 // in case the map key does not exactly match formatActionCacheKey
342 // (key/version mismatch in the cache file).
343 for k, entry := range c.Entries {
344 if entry.Repo == repo && entry.Version == version {
345 delete(c.Entries, k)
346 deleted = true
347 actionCacheLog.Printf("Deleted cache entry with mismatched key: key=%s, repo=%s, version=%s", k, repo, version)
348 }
349 }
350
351 if deleted {
352 c.dirty = true
353 }
354}
355
356// DeleteByKey removes the cache entry with the given raw map key.
357// This is useful when the caller already holds the exact key from iterating

Callers 6

getRepositoryFeaturesFunction · 0.80
UnquoteYAMLKeyFunction · 0.80

Calls 2

formatActionCacheKeyFunction · 0.85
PrintfMethod · 0.45