Skip to content

Commit

Permalink
Merge pull request #768 from containers/progress-bar-2
Browse files Browse the repository at this point in the history
There would be one case where this wouldn't work
  • Loading branch information
rhatdan authored Feb 10, 2025
2 parents 8df5070 + ad4300f commit c86dbaa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ramalama/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def perform_download(self, file, progress):
while True:
data = self.response.read(1024)
if not data:
break
return

size = file.write(data)
if progress:
Expand All @@ -69,8 +69,10 @@ def perform_download(self, file, progress):
accumulated_size = 0
last_update_time = time.time()

if accumulated_size:
if accumulated_size > 0:
self.update_progress(accumulated_size)

if progress:
print("\033[K", end="\r")

def human_readable_time(self, seconds):
Expand Down

0 comments on commit c86dbaa

Please sign in to comment.