mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 21:12:59 +02:00
Add a increasing delay after a pingtest failure
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user