Skip to content

Commit

Permalink
continue to respect minchunksize
Browse files Browse the repository at this point in the history
  • Loading branch information
philandstuff committed Mar 5, 2024
1 parent 401e975 commit fae7259
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,17 @@ func runRootCMD(cmd *cobra.Command, args []string) error {
// returns any/all errors to the caller.
func rootExecute(ctx context.Context, urlString, dest string) error {
chunkSize, err := humanize.ParseBytes(viper.GetString(config.OptMinimumChunkSize))
if err != nil {
return fmt.Errorf("error parsing chunk size: %w", err)
}
minChunkSize, err := humanize.ParseBytes(viper.GetString(config.OptMinimumChunkSize))
if err != nil {
return fmt.Errorf("error parsing minimum chunk size: %w", err)
}
if chunkSize < minChunkSize {
// minChunkSize is deprecated but we should still respect it
chunkSize = minChunkSize
}

resolveOverrides, err := config.ResolveOverridesToMap(viper.GetStringSlice(config.OptResolve))
if err != nil {
Expand Down

0 comments on commit fae7259

Please sign in to comment.