Skip to content

Commit

Permalink
sync progress
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Jan 19, 2024
1 parent 4b5700a commit c807206
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pmtiles/makesync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit c807206

Please sign in to comment.