http_client: modify download progress reporting
Report progress for each percentage change. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
f8a38abc89
commit
c1eda1ef3d
|
@ -470,7 +470,8 @@ class StreamingDownload:
|
|||
self.total_recd += len(chunk)
|
||||
if self.download_size > 0 and self.progress_callback is not None:
|
||||
pct = int(self.total_recd / self.download_size * 100 + .5)
|
||||
if pct - self.pct_done > 5:
|
||||
pct = min(100, pct)
|
||||
if pct != self.pct_done:
|
||||
self.pct_done = pct
|
||||
self.progress_callback(
|
||||
pct, self.download_size, self.total_recd)
|
||||
|
|
Loading…
Reference in New Issue