GetByCacheKey retrieves a cached entry by its pre-computed key. This avoids recomputing the cache key when the caller has already computed it.
(key string)
| 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. |
| 383 | func (c *ActionCache) GetByCacheKey(key string) (string, bool) { |
| 384 | entry, exists := c.Entries[key] |
| 385 | if !exists { |
| 386 | actionCacheLog.Printf("Cache miss for key=%s", key) |
| 387 | return "", false |
| 388 | } |
| 389 | actionCacheLog.Printf("Cache hit for key=%s, sha=%s", key, entry.SHA) |
| 390 | return entry.SHA, true |
| 391 | } |
| 392 | |
| 393 | // FindEntryBySHA finds a cache entry with the given repo and SHA |
| 394 | // Returns the entry and true if found, or empty entry and false if not found |