]> git.ipfire.org Git - pakfire.git/commitdiff
http: Only initialize the progress bar once
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Dec 2016 20:11:34 +0000 (21:11 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Dec 2016 20:11:34 +0000 (21:11 +0100)
When a request fails and we move to the next mirror
we do not want to show an other progressbar.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/http.py

index 12e0f35306b34e6b911b738bb4bf49c288327499..2f4bb1c1c4f47c1308ff13058c01cc34ca5df142 100644 (file)
@@ -288,8 +288,8 @@ class Client(object):
                        self._next_mirror()
 
                try:
-                       while True:
-                               with self._make_progressbar(message) as p:
+                       with self._make_progressbar(message) as p:
+                               while True:
                                        with open(filename, "wb") as f:
                                                # Exclusively lock the file for download
                                                try: