INNER CODE UNIT · Go

manifestFromCache

tazjin/nixery · builder/cache.go:103

func manifestFromCache(ctx context.Context, s *State, key string) (json.RawMessage, bool) {
	if m, cached := s.Cache.manifestFromLocalCache(key); cached {
		return m, true
	}

	r, err := s.Storage.Fetch(ctx, "manifests/"+key)
	if err != nil {
		slog.Error("failed to fetch manifest from cache", "err", err, "manifest", key, "backend", s.Storage.Name())

		return nil, false
	}
	defer r.Close()

	m, err := io.ReadAll(r)
	if err != nil {
		slog.Error("failed to read cached manifest from storage backend", "err", err, "manifest", key, "backend", s.Storage.Name())

		return nil, false

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…