Add a increasing delay after a pingtest failure

This commit is contained in:
Arne Fitzenreiter
2008-08-25 21:33:12 +02:00
parent b6f9783fb1
commit e4e4b3f975
2 changed files with 9 additions and 0 deletions

View 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

View 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;
}
}
}
}
}