diff --git a/pmtiles/makesync.go b/pmtiles/makesync.go index 83a7e64..70ec288 100644 --- a/pmtiles/makesync.go +++ b/pmtiles/makesync.go @@ -328,7 +328,7 @@ func Sync(logger *log.Logger, file string, syncfilename string) error { } bar := progressbar.Default( - int64(header.TileEntriesCount), + int64(len(blocks)), "calculating diff", ) @@ -374,16 +374,16 @@ func Sync(logger *log.Logger, file string, syncfilename string) error { } CollectEntries(header.RootOffset, header.RootLength, func(e EntryV3) { - bar.Add(1) - if idx < len(blocks) { for e.TileId > blocks[idx].Start { wanted = append(wanted, blocks[idx]) + bar.Add(1) idx = idx + 1 } if e.TileId == blocks[idx].Start { tasks <- blocks[idx] + bar.Add(1) idx = idx + 1 } }