From c807206b6f41144a1b32f0418b99b8ef52680850 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Fri, 19 Jan 2024 18:18:01 +0800 Subject: [PATCH] sync progress --- pmtiles/makesync.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } }