Get retrieves a cached entry if it exists
(repo, version string)
| 367 | |
| 368 | // Get retrieves a cached entry if it exists |
| 369 | func (c *ActionCache) Get(repo, version string) (string, bool) { |
| 370 | key := formatActionCacheKey(repo, version) |
| 371 | entry, exists := c.Entries[key] |
| 372 | if !exists { |
| 373 | actionCacheLog.Printf("Cache miss for key=%s", key) |
| 374 | return "", false |
| 375 | } |
| 376 | |
| 377 | actionCacheLog.Printf("Cache hit for key=%s, sha=%s", key, entry.SHA) |
| 378 | return entry.SHA, true |
| 379 | } |
| 380 | |
| 381 | // GetByCacheKey retrieves a cached entry by its pre-computed key. |
| 382 | // This avoids recomputing the cache key when the caller has already computed it. |