Loading registry/datastore/repository.go +5 −4 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ const ( greaterThan = ">" // sizeWithDescendantsKeyTTL is the TTL for the cached value of the "size with descendants" for a given repository. sizeWithDescendantsKeyTTL = 2 * time.Minute sizeWithDescendantsKeyTTL = 5 * time.Minute ) // FilterParams contains the specific filters used to get Loading Loading @@ -1740,13 +1740,14 @@ func (s *repositoryStore) SizeWithDescendants(ctx context.Context, r *models.Rep return RepositorySize{bytes: b}, err } if found, b := s.cache.GetSizeWithDescendants(ctx, r); found { return RepositorySize{b, true}, nil } if s.cache.HasSizeWithDescendantsTimedOut(ctx, r) { return RepositorySize{}, ErrSizeHasTimedOut } if found, b := s.cache.GetSizeWithDescendants(ctx, r); found { return RepositorySize{b, true}, nil } b, err := s.topLevelSizeWithDescendants(ctx, r) if err != nil { var pgErr *pgconn.PgError Loading registry/handlers/repositories.go +1 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,7 @@ func (h *repositoryHandler) GetRepository(w http.ResponseWriter, r *http.Request "is_top_level": repo.IsTopLevel(), "root_repo": repo.TopLevelPathSegment(), "precision": precision, "failure": err != nil, }).Info("repository size measurement") if err != nil { h.Errors = append(h.Errors, errcode.FromUnknownError(err)) Loading Loading
registry/datastore/repository.go +5 −4 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ const ( greaterThan = ">" // sizeWithDescendantsKeyTTL is the TTL for the cached value of the "size with descendants" for a given repository. sizeWithDescendantsKeyTTL = 2 * time.Minute sizeWithDescendantsKeyTTL = 5 * time.Minute ) // FilterParams contains the specific filters used to get Loading Loading @@ -1740,13 +1740,14 @@ func (s *repositoryStore) SizeWithDescendants(ctx context.Context, r *models.Rep return RepositorySize{bytes: b}, err } if found, b := s.cache.GetSizeWithDescendants(ctx, r); found { return RepositorySize{b, true}, nil } if s.cache.HasSizeWithDescendantsTimedOut(ctx, r) { return RepositorySize{}, ErrSizeHasTimedOut } if found, b := s.cache.GetSizeWithDescendants(ctx, r); found { return RepositorySize{b, true}, nil } b, err := s.topLevelSizeWithDescendants(ctx, r) if err != nil { var pgErr *pgconn.PgError Loading
registry/handlers/repositories.go +1 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,7 @@ func (h *repositoryHandler) GetRepository(w http.ResponseWriter, r *http.Request "is_top_level": repo.IsTopLevel(), "root_repo": repo.TopLevelPathSegment(), "precision": precision, "failure": err != nil, }).Info("repository size measurement") if err != nil { h.Errors = append(h.Errors, errcode.FromUnknownError(err)) Loading