Stop Counters where they're constructed and started

This commit is contained in:
greatroar
2020-11-08 21:03:59 +01:00
parent ddca699cd2
commit 21b787a4d1
8 changed files with 7 additions and 11 deletions

View File

@@ -51,8 +51,6 @@ type Lister interface {
// New creates a new index for repo from scratch. InvalidFiles contains all IDs
// of files that cannot be listed successfully.
func New(ctx context.Context, repo Lister, ignorePacks restic.IDSet, p *progress.Counter) (idx *Index, invalidFiles restic.IDs, err error) {
defer p.Done()
type Job struct {
PackID restic.ID
Size int64
@@ -191,8 +189,6 @@ func loadIndexJSON(ctx context.Context, repo ListLoader, id restic.ID) (*indexJS
func Load(ctx context.Context, repo ListLoader, p *progress.Counter) (*Index, error) {
debug.Log("loading indexes")
defer p.Done()
supersedes := make(map[restic.ID]restic.IDSet)
results := make(map[restic.ID]map[restic.ID]Pack)