mirror of
https://github.com/kopia/kopia.git
synced 2026-04-28 09:59:10 -04:00
Rename Cache.c.getEntriesFromCacheLocked
Follows the naming convention for the locking requirements
This commit is contained in:
committed by
Jarek Kowalski
parent
467243f23c
commit
c5cb83c2e3
@@ -89,7 +89,7 @@ func (c *Cache) Readdir(ctx context.Context, d fs.Directory) (fs.Entries, error)
|
||||
return d.Readdir(ctx)
|
||||
}
|
||||
|
||||
func (c *Cache) getEntriesFromCache(id string) fs.Entries {
|
||||
func (c *Cache) getEntriesFromCacheLocked(id string) fs.Entries {
|
||||
if v, ok := c.data[id]; id != "" && ok {
|
||||
if time.Now().Before(v.expireAfter) {
|
||||
c.moveToHead(v)
|
||||
@@ -118,7 +118,7 @@ func (c *Cache) getEntries(ctx context.Context, id string, expirationTime time.D
|
||||
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
if entries := c.getEntriesFromCache(id); entries != nil {
|
||||
if entries := c.getEntriesFromCacheLocked(id); entries != nil {
|
||||
return entries, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user