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
| 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. |
| 90 | type Cache struct { |
| 91 | lock sync.Mutex |
| 92 | data map[uuid.UUID]*cacheEntry |
| 93 | authz rbac.Authorizer |
| 94 | |
| 95 | // metrics |
| 96 | cacheMetrics |
| 97 | } |
| 98 | |
| 99 | type cacheMetrics struct { |
| 100 | currentOpenFileReferences prometheus.Gauge |
nothing calls this directly
no outgoing calls
no test coverage detected