[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] don't immediately retry to download a package



The following patch changes our failure callback to wait before retrying
to download a package.  We have to do this because urlgrabber doesn't
provide a mechanism for this which I guess could be considered a feature
because of the flexibility it allows.

Anyway it starts by waiting 0.25s and waits twice as much each time.
The use of the window is obvious.  Thoughts?

- Chris


diff --git a/yuminstall.py b/yuminstall.py
index 6af8b65..aae0037 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -556,6 +556,14 @@ class AnacondaYum(YumSorter):
     def urlgrabberFailureCB (self, obj, *args, **kwargs):
         log.warning("Try %s/%s for %s failed" % (obj.tries, obj.retry, obj.url))
 
+        delay = 0.25*(2**(obj.tries-1))
+        if delay > 1:
+            w = anaconda.intf.waitWindow(_("Retrying"), _("Retrying package download..."))
+            time.sleep(delay)
+            w.pop()
+        else:
+            time.sleep(delay)
+
     def getDownloadPkgs(self):
         downloadpkgs = []
         totalSize = 0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]