Skip to content

Commit

Permalink
optimizations to sync/makesync
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Mar 7, 2024
1 parent 8f41de2 commit 815e557
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 97 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ var cli struct {

Makesync struct {
Input string `arg:"" type:"existingfile"`
BlockSizeKb int `default:"1000" help:"The approximate block size, in kilobytes. 0 means 1 tile = 1 block."`
BlockSizeKb int `default:"20" help:"The approximate block size, in kilobytes. 0 means 1 tile = 1 block."`
HashFunction string `default:"fnv1a" help:"The hash function."`
Checksum string `help:"Store a checksum in the syncfile."`
} `cmd:"" hidden:""`

Sync struct {
Existing string `arg:"" type:"existingfile"`
Syncfile string `arg:"" type:"existingfile"`
Overfetch float32 `default:0.05 help:"What ratio of extra data to download to minimize # requests; 0.2 is 20%"`
} `cmd:"" hidden:""`

Serve struct {
Expand Down Expand Up @@ -211,7 +212,7 @@ func main() {
logger.Fatalf("Failed to makesync archive, %v", err)
}
case "sync <existing> <syncfile>":
err := pmtiles.Sync(logger, cli.Sync.Existing, cli.Sync.Syncfile)
err := pmtiles.Sync(logger, cli.Sync.Existing, cli.Sync.Syncfile, cli.Sync.Overfetch)
if err != nil {
logger.Fatalf("Failed to sync archive, %v", err)
}
Expand Down
Loading

0 comments on commit 815e557

Please sign in to comment.