MCPcopy Create free account
hub / github.com/celer-pkg/celer / ResetMetaCache

Function ResetMetaCache

configs/port_pkgcache.go:41–66  ·  view source on GitHub ↗

ResetMetaCache clears all metadata caches. Called at the start of each celer command to avoid stale data across invocations.

()

Source from the content-addressed store, hash-verified

39// ResetMetaCache clears all metadata caches. Called at the start of each celer
40// command to avoid stale data across invocations.
41func ResetMetaCache() {
42 buildMetaCache.Range(func(k, v any) bool {
43 buildMetaCache.Delete(k)
44 return true
45 })
46 portTomlCache.Range(func(k, v any) bool {
47 portTomlCache.Delete(k)
48 return true
49 })
50 commitHashCache.Range(func(k, v any) bool {
51 commitHashCache.Delete(k)
52 return true
53 })
54 buildConfigCache.Range(func(k, v any) bool {
55 buildConfigCache.Delete(k)
56 return true
57 })
58 hostSupportedCache.Range(func(k, v any) bool {
59 hostSupportedCache.Delete(k)
60 return true
61 })
62
63 // Also clear the pkgcache-level buildMeta cache (the recursive one inside
64 // metadata.go that caches per nameVersion|native).
65 pkgcache.ResetMetaCache()
66}
67
68func (p Port) buildhash() (string, error) {
69 metaData, err := p.buildMeta()

Callers 1

NewCelerFunction · 0.70

Calls 1

ResetMetaCacheFunction · 0.92

Tested by

no test coverage detected