()
| 52 | } |
| 53 | |
| 54 | func cleanCache() { |
| 55 | cacheMu.Lock() |
| 56 | defer cacheMu.Unlock() |
| 57 | now := time.Now() |
| 58 | for key, entry := range cache { |
| 59 | if now.After(entry.expiration) { |
| 60 | cacheLRU.Remove(entry.lruElement) |
| 61 | delete(cache, key) |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | func getCache(key string) ([]DirEntryResult, bool) { |
| 67 | cacheMu.Lock() |