MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / get

Method get

internal/desktop/tool_cache.go:79–90  ·  view source on GitHub ↗

get returns the cached entry for name and whether it is still fresh (within detectionTTL). A stale or missing entry reports fresh=false so the caller knows to re-probe.

(name string)

Source from the content-addressed store, hash-verified

77// (within detectionTTL). A stale or missing entry reports fresh=false so the
78// caller knows to re-probe.
79func (c *detectionCache) get(name string) (detectionEntry, bool) {
80 c.mu.RLock()
81 defer c.mu.RUnlock()
82 entry, ok := c.entries[name]
83 if !ok {
84 return detectionEntry{}, false
85 }
86 if entry.DetectedAt.IsZero() || time.Since(entry.DetectedAt) > detectionTTL {
87 return entry, false
88 }
89 return entry, true
90}
91
92// put stores a fresh detection result.
93func (c *detectionCache) put(name string, installed bool, version string) {

Calls

no outgoing calls