MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getCache

Function getCache

pkg/suggestion/filewalk.go:66–82  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

64}
65
66func getCache(key string) ([]DirEntryResult, bool) {
67 cacheMu.Lock()
68 defer cacheMu.Unlock()
69 entry, ok := cache[key]
70 if !ok {
71 return nil, false
72 }
73 if time.Now().After(entry.expiration) {
74 // expired
75 cacheLRU.Remove(entry.lruElement)
76 delete(cache, key)
77 return nil, false
78 }
79 // update LRU order
80 cacheLRU.MoveToFront(entry.lruElement)
81 return entry.value, true
82}
83
84func setCache(key string, value []DirEntryResult) {
85 cacheMu.Lock()

Callers 1

listDirectoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected