]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Add a increasing delay after a pingtest failure
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 25 Aug 2008 19:33:12 +0000 (21:33 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 25 Aug 2008 19:33:12 +0000 (21:33 +0200)
config/rootfiles/updater/filelists/core18
src/pakfire/lib/functions.pl

index 8408c3cf0738967e8d80fea6b7fb4e5c2560fad1..6b9302fdc1649ef23ab650ce07c02c77f51d90f5 100644 (file)
@@ -1,4 +1,5 @@
 opt/pakfire/db/core/mine
+opt/pakfire/lib/functions.pl
 etc/mkinitcpio.conf
 etc/init.d/mISDN
 etc/modprobe.d/blacklist
index 650976281f348f2a3ec5c56a2a835258d475fdfd..491c4b076c283897b310c952dab76cd1c56a404b 100644 (file)
@@ -311,6 +311,7 @@ sub selectmirror {
        #   This will never give up.
        my $found = 0;
        my $servers = 0;
+       my $pingdelay = 1;
        while ($found == 0) {
                $server = int(rand($scount) + 1);
                $servers = 0;
@@ -327,6 +328,13 @@ sub selectmirror {
                                        $found = 1;
                                        return ($proto, $host, $path);
                                }
+                               if ($found == 0) {
+                                       sleep($pingdelay);
+                                       $pingdelay=$pingdelay*2;
+                                       if ($pingdelay>1200) {
+                                               $pingdelay=1200;
+                                       }
+                               }
                        }
                }
        }