repository: Use backend.ID to load index

This commit uses ParallelWorkFuncParseID() to load all indexes and
ignores file names with invalid format.

This fixes #475.
This commit is contained in:
Alexander Neumann
2016-02-24 22:41:32 +01:00
parent 77d85cee52
commit 4ae16d7661
7 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ func (cmd CmdDump) DumpIndexes() error {
for id := range cmd.repo.List(backend.Index, done) {
fmt.Printf("index_id: %v\n", id)
idx, err := repository.LoadIndex(cmd.repo, id.String())
idx, err := repository.LoadIndex(cmd.repo, id)
if err != nil {
return err
}
+1 -1
View File
@@ -71,7 +71,7 @@ func (cmd CmdRebuildIndex) RebuildIndex() error {
cmd.global.Printf(" loading index %v\n", i)
debug.Log("RebuildIndex.RebuildIndex", "load index %v", indexID.Str())
idx, err := repository.LoadIndex(cmd.repo, indexID.String())
idx, err := repository.LoadIndex(cmd.repo, indexID)
if err != nil {
return err
}