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

Function cacheTTLFromCommon

internal/cli/launch.go:176–192  ·  view source on GitHub ↗

cacheTTLFromCommon reads provider metadata cache_ttl_seconds from the store-backed file shape. Default: 24h.

(common map[string]any)

Source from the content-addressed store, hash-verified

174// cacheTTLFromCommon reads provider metadata cache_ttl_seconds from the store-backed file shape.
175// Default: 24h.
176func cacheTTLFromCommon(common map[string]any) time.Duration {
177 const defaultSeconds = int64(86400)
178 seconds := defaultSeconds
179 if common != nil {
180 if v, ok := common["cache_ttl_seconds"]; ok {
181 switch n := v.(type) {
182 case float64:
183 seconds = int64(n)
184 case int:
185 seconds = int64(n)
186 case int64:
187 seconds = n
188 }
189 }
190 }
191 return time.Duration(seconds) * time.Second
192}
193
194// autoResolve fills missing pinned fields using today's
195// auto-selection logic (first matching endpoint, first model). Used

Callers 1

resolveLaunchSelectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected