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

Struct Cache

coderd/files/cache.go:90–97  ·  view source on GitHub ↗

Cache persists the files for template versions, and is used by dynamic parameters to deduplicate the files in memory. When any number of users opens the workspace creation form for a given template version, it's files are loaded into memory exactly once. We hold those files until there are no longer

Source from the content-addressed store, hash-verified

88// loaded into memory exactly once. We hold those files until there are no
89// longer any open connections, and then we remove the value from the map.
90type Cache struct {
91 lock sync.Mutex
92 data map[uuid.UUID]*cacheEntry
93 authz rbac.Authorizer
94
95 // metrics
96 cacheMetrics
97}
98
99type cacheMetrics struct {
100 currentOpenFileReferences prometheus.Gauge

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected