Count returns the number of files currently in the cache. Mainly used for unit testing assertions.
()
| 281 | // Count returns the number of files currently in the cache. |
| 282 | // Mainly used for unit testing assertions. |
| 283 | func (c *Cache) Count() int { |
| 284 | c.lock.Lock() |
| 285 | defer c.lock.Unlock() |
| 286 | |
| 287 | return len(c.data) |
| 288 | } |
| 289 | |
| 290 | func fetch(store database.Store, fileID uuid.UUID) (CacheEntryValue, error) { |
| 291 | // Because many callers can be waiting on the same file fetch concurrently, we |