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

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

 



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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux