mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
update progressbar every MIN(1%, 512kB)
This commit is contained in:
parent
862e223cec
commit
bccf06c748
1 changed files with 3 additions and 3 deletions
|
@ -78,10 +78,10 @@ func (r *progressReader) Read(p []byte) (n int, err error) {
|
|||
read, err := io.ReadCloser(r.reader).Read(p)
|
||||
r.readProgress += read
|
||||
|
||||
updateEvery := 4096
|
||||
updateEvery := 1024*512 //512kB
|
||||
if r.readTotal > 0 {
|
||||
// Only update progress for every 1% read
|
||||
if increment := int(0.01 * float64(r.readTotal)); increment > updateEvery {
|
||||
// Update progress for every 1% read if 1% < 512kB
|
||||
if increment := int(0.01 * float64(r.readTotal)); increment < updateEvery {
|
||||
updateEvery = increment
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue