MCPcopy Create free account
hub / github.com/diillson/chatcli / IsStale

Method IsStale

cli/workspace/bootstrap.go:97–115  ·  view source on GitHub ↗

IsStale checks if any cached file has been modified on disk.

()

Source from the content-addressed store, hash-verified

95
96// IsStale checks if any cached file has been modified on disk.
97func (bl *BootstrapLoader) IsStale() bool {
98 bl.mu.RLock()
99 defer bl.mu.RUnlock()
100
101 for path, cached := range bl.cache {
102 info, err := os.Stat(path)
103 if err != nil {
104 // File was deleted; cache is stale
105 if cached.content != "" {
106 return true
107 }
108 continue
109 }
110 if info.ModTime().After(cached.modTime) {
111 return true
112 }
113 }
114 return false
115}
116
117// InvalidateCache forces reload on next call.
118func (bl *BootstrapLoader) InvalidateCache() {

Callers 2

TestIsStaleFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestIsStaleFunction · 0.76