repository: Properly set id for finalized index

As MergeFinalIndex and index uploads can occur concurrently, it is
necessary for MergeFinalIndex to check whether the IDs for an index were
already set before merging it. Otherwise, we'd loose the ID of an index
which is set _after_ uploading it.
This commit is contained in:
Michael Eischer
2022-06-05 21:57:16 +02:00
parent e0a7852b8b
commit bf81bf0795
4 changed files with 24 additions and 26 deletions

View File

@@ -582,12 +582,6 @@ func (r *Repository) LoadIndex(ctx context.Context) error {
if err != nil {
return err
}
_, err = idx.IDs()
if err != nil {
return err
}
r.idx.Insert(idx)
return nil
})