diff --git a/archiver.go b/archiver.go index a05ccf651..91a2f348b 100644 --- a/archiver.go +++ b/archiver.go @@ -63,6 +63,8 @@ func NewArchiver(s Server, p *Progress) (*Archiver, error) { // Preload loads all tree objects from repository and adds all blobs that are // still available to the map for deduplication. func (arch *Archiver) Preload() error { + debug.Log("Archiver.Preload", "Start loading known blobs") + // load all trees, in parallel worker := func(wg *sync.WaitGroup, c <-chan backend.ID) { for id := range c { @@ -72,6 +74,8 @@ func (arch *Archiver) Preload() error { return } + debug.Log("Archiver.Preload", "load tree %v with %d blobs", id, tree.Map.Len()) + arch.m.Merge(tree.Map) } wg.Done() @@ -87,7 +91,13 @@ func (arch *Archiver) Preload() error { } // list ids + trees := 0 err := arch.s.EachID(backend.Tree, func(id backend.ID) { + trees++ + + if trees%1000 == 0 { + debug.Log("Archiver.Preload", "Loaded %v trees", trees) + } idCh <- id }) @@ -96,6 +106,8 @@ func (arch *Archiver) Preload() error { // wait for workers wg.Wait() + debug.Log("Archiver.Preload", "Loaded %v blobs from %v trees", arch.m.Len(), trees) + return err }