Skip to content

Commit

Permalink
add type checking to ensure that both int and float types can be used…
Browse files Browse the repository at this point in the history
… in retry-interval.
  • Loading branch information
elvis972602 committed Mar 3, 2023
1 parent 328ee30 commit 01dd43a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,13 @@ func setFlag() {
retry = config["retry"].(int)
}
if !isFlagPassed("retry-interval") && config["retry-interval"] != nil {
retryInterval = config["retry-interval"].(float64)
// check if retry-interval is float64 or int
_, ok := config["retry-interval"].(float64)
if !ok {
retryInterval = float64(config["retry-interval"].(int))
} else {
retryInterval = config["retry-interval"].(float64)
}
}
if !isFlagPassed("max-download-parallel") && config["max-download-parallel"] != nil {
maxDownloadParallel = config["max-download-parallel"].(int)
Expand Down

0 comments on commit 01dd43a

Please sign in to comment.