repository: simplify CreateIndexFromPacks
This commit is contained in:
parent
1974ad7ce2
commit
e68c3a4e62
1 changed files with 1 additions and 5 deletions
|
@ -643,7 +643,6 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
idx := NewIndex()
|
|
||||||
// a worker receives an pack ID from ch, reads the pack contents, and adds them to idx
|
// a worker receives an pack ID from ch, reads the pack contents, and adds them to idx
|
||||||
worker := func() error {
|
worker := func() error {
|
||||||
for fi := range ch {
|
for fi := range ch {
|
||||||
|
@ -654,7 +653,7 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest
|
||||||
invalid = append(invalid, fi.ID)
|
invalid = append(invalid, fi.ID)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
}
|
}
|
||||||
idx.StorePack(fi.ID, entries)
|
r.idx.StorePack(fi.ID, entries)
|
||||||
p.Add(1)
|
p.Add(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,9 +670,6 @@ func (r *Repository) CreateIndexFromPacks(ctx context.Context, packsize map[rest
|
||||||
return invalid, errors.Fatal(err.Error())
|
return invalid, errors.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add idx to MasterIndex
|
|
||||||
r.idx.Insert(idx)
|
|
||||||
|
|
||||||
return invalid, nil
|
return invalid, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue