index: gracefully handle duplicate module indexes (#1645)

* index: gracefully handle duplicate module indexes

* fix memory impl
This commit is contained in:
Marwan Sulaiman
2020-07-03 10:42:51 -04:00
committed by GitHub
parent ae69e1f57d
commit d6f06d0302
5 changed files with 62 additions and 5 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func (s *stasher) Stash(ctx context.Context, mod, ver string) (string, error) {
return "", errors.E(op, err)
}
err = s.indexer.Index(ctx, mod, v.Semver)
if err != nil {
if err != nil && !errors.Is(err, errors.KindAlreadyExists) {
return "", errors.E(op, err)
}
return v.Semver, nil