ResetMetaCache clears all metadata caches. Called at the start of each celer command to avoid stale data across invocations.
()
| 39 | // ResetMetaCache clears all metadata caches. Called at the start of each celer |
| 40 | // command to avoid stale data across invocations. |
| 41 | func 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 | |
| 68 | func (p Port) buildhash() (string, error) { |
| 69 | metaData, err := p.buildMeta() |
no test coverage detected