Change default split connection count to 2
This commit is contained in:
parent
38601c7e2d
commit
b65bbeebe6
6 changed files with 28 additions and 22 deletions
|
@ -1,3 +1,6 @@
|
|||
0.1.9:
|
||||
- Change default split connection count to 2
|
||||
|
||||
0.1.8:
|
||||
- Version bump
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ OPTIONS:
|
|||
--dir value, -d value directory to save in (default: current directory) [$GOPHAST_DIR]
|
||||
--downloads value, -j value number of files to download concurrently (default: 5) [$GOPHAST_DOWNLOADS]
|
||||
--out value, -o value file name to save as (default: from URL) [$GOPHAST_OUT]
|
||||
--split-conns value, -x value split download using multiple connections (default: 3) [$GOPHAST_SPLIT_CONNECTIONS]
|
||||
--split-conns value, -x value split download using multiple connections (default: 2) [$GOPHAST_SPLIT_CONNECTIONS]
|
||||
--split-servers value, -s value split download using multiple URLs (default: 1) [$GOPHAST_SPLIT_SERVERS]
|
||||
--split-size value, -k value minimum byte range size (default: 10485760) [$GOPHAST_SPLIT_SIZE]
|
||||
--help, -h show help
|
||||
|
|
10
go.mod
10
go.mod
|
@ -1,15 +1,15 @@
|
|||
module gitlab.com/tslocum/gophast
|
||||
|
||||
go 1.13
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0
|
||||
github.com/mattn/go-isatty v0.0.12
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/urfave/cli v1.22.2
|
||||
github.com/vbauerster/mpb/v4 v4.11.2
|
||||
github.com/urfave/cli v1.22.4
|
||||
github.com/vbauerster/mpb/v5 v5.2.4
|
||||
gitlab.com/tslocum/preallocate v0.1.3
|
||||
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
|
||||
golang.org/x/sys v0.0.0-20200805065543-0cf7623e9dbd // indirect
|
||||
)
|
||||
|
|
23
go.sum
23
go.sum
|
@ -13,6 +13,8 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
|
|||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
|
@ -24,25 +26,24 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
|
|||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
|
||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vbauerster/mpb/v4 v4.11.2 h1:ynkUoKzi65DZ1UsQPx7sgi/KN6G9f7br+Us2nKm35AM=
|
||||
github.com/vbauerster/mpb/v4 v4.11.2/go.mod h1:jIuIRCltGJUnm6DCyPVkwjlLUk4nHTH+m4eD14CdFF0=
|
||||
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
|
||||
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vbauerster/mpb/v5 v5.2.4 h1:PLP8vv75RcEgxGoJVtKaRD2FHSxEmIV/u4ZuOrfO8Qg=
|
||||
github.com/vbauerster/mpb/v5 v5.2.4/go.mod h1:K4iCHQp5sWnmAgEn+uW1sAxSilctb4JPAGXx49jV+Aw=
|
||||
gitlab.com/tslocum/preallocate v0.1.3 h1:l9IiSYuL9a9ZQB4FEKLdiWWGBTE/8qYJ0B5JsgMSDFA=
|
||||
gitlab.com/tslocum/preallocate v0.1.3/go.mod h1:igX8EmWKgzO/KZOaCA3Ex3JJCr6RK2Y+zqhNwVuKX14=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd h1:Wf+k80tMDcKkeQiGIgNFmhv4GDSTXoUBhm+33x2ApdA=
|
||||
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200805065543-0cf7623e9dbd h1:wefLe/3g5tC0FcXw3NneLA5tHgbyouyZlfcSjNfOdgk=
|
||||
golang.org/x/sys v0.0.0-20200805065543-0cf7623e9dbd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
|
|
@ -10,7 +10,7 @@ const (
|
|||
DefaultMinSplitSizeFormatted = "10 MiB"
|
||||
DefaultConnectTimeout = 1 * time.Minute
|
||||
DefaultTransferTimeout = 20 * time.Second
|
||||
DefaultMaxConnections = 3
|
||||
DefaultMaxConnections = 2
|
||||
DefaultAutoSaveControl = 15 * time.Second
|
||||
DefaultRetryDelay = 2 * time.Second
|
||||
DefaultMaxRetries = 0
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/vbauerster/mpb/v4"
|
||||
"github.com/vbauerster/mpb/v4/decor"
|
||||
"github.com/vbauerster/mpb/v5"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"gitlab.com/tslocum/gophast/pkg/config"
|
||||
. "gitlab.com/tslocum/gophast/pkg/utils"
|
||||
)
|
||||
|
@ -81,7 +81,8 @@ func handleLocalProgressBar(bar *mpb.Bar, r *ByteRange) {
|
|||
if r == nil {
|
||||
return
|
||||
} else if r.Progress != lastProgress {
|
||||
bar.IncrInt64(r.Progress-lastProgress, time.Now().Sub(lastUpdate))
|
||||
bar.IncrInt64(r.Progress - lastProgress)
|
||||
bar.DecoratorEwmaUpdate(time.Now().Sub(lastUpdate))
|
||||
|
||||
lastProgress = r.Progress
|
||||
lastUpdate = time.Now()
|
||||
|
@ -142,7 +143,8 @@ func handleGlobalProgressBar(bar *mpb.Bar, d *Download) {
|
|||
}
|
||||
|
||||
if progress != lastProgress {
|
||||
bar.IncrInt64(progress-lastProgress, time.Now().Sub(lastUpdate))
|
||||
bar.IncrInt64(progress - lastProgress)
|
||||
bar.DecoratorEwmaUpdate(time.Now().Sub(lastUpdate))
|
||||
|
||||
lastProgress = progress
|
||||
lastUpdate = time.Now()
|
||||
|
|
Loading…
Reference in a new issue