MCPcopy Index your code
hub / github.com/coder/coder / cachedProviders

Method cachedProviders

coderd/x/chatd/configcache.go:164–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162}
163
164func (c *chatConfigCache) cachedProviders() ([]database.AIProvider, bool) {
165 c.mu.RLock()
166 entry := c.providers
167 c.mu.RUnlock()
168 if entry == nil {
169 return nil, false
170 }
171 if c.clock.Now().Before(entry.expiresAt) {
172 return slices.Clone(entry.providers), true
173 }
174
175 c.mu.Lock()
176 if current := c.providers; current != nil && !c.clock.Now().Before(current.expiresAt) {
177 c.providers = nil
178 }
179 c.mu.Unlock()
180
181 return nil, false
182}
183
184func (c *chatConfigCache) providersGeneration() uint64 {
185 c.mu.RLock()

Callers 1

EnabledProvidersMethod · 0.95

Calls 3

CloneMethod · 0.45
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected