Skip to content

Commit

Permalink
Only fetch versions while list is called (gomods#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
manugupt1 authored and marpio committed Dec 9, 2018
1 parent fe032bc commit 1d7155e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/storage/mongo/lister.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ func (s *ModuleStore) List(ctx context.Context, module string) ([]string, error)
ctx, span := observ.StartSpan(ctx, op.String())
defer span.End()
c := s.s.DB(s.d).C(s.c)
fields := bson.M{"version": 1}
result := make([]storage.Module, 0)
err := c.Find(bson.M{"module": module}).All(&result)
err := c.Find(bson.M{"module": module}).Select(fields).All(&result)
if err != nil {
kind := errors.KindUnexpected
if err == mgo.ErrNotFound {
Expand Down

0 comments on commit 1d7155e

Please sign in to comment.