mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +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/db/core/mine
|
||||||
|
opt/pakfire/lib/functions.pl
|
||||||
etc/mkinitcpio.conf
|
etc/mkinitcpio.conf
|
||||||
etc/init.d/mISDN
|
etc/init.d/mISDN
|
||||||
etc/modprobe.d/blacklist
|
etc/modprobe.d/blacklist
|
||||||
|
|||||||
@@ -311,6 +311,7 @@ sub selectmirror {
|
|||||||
# This will never give up.
|
# This will never give up.
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
my $servers = 0;
|
my $servers = 0;
|
||||||
|
my $pingdelay = 1;
|
||||||
while ($found == 0) {
|
while ($found == 0) {
|
||||||
$server = int(rand($scount) + 1);
|
$server = int(rand($scount) + 1);
|
||||||
$servers = 0;
|
$servers = 0;
|
||||||
@@ -327,6 +328,13 @@ sub selectmirror {
|
|||||||
$found = 1;
|
$found = 1;
|
||||||
return ($proto, $host, $path);
|
return ($proto, $host, $path);
|
||||||
}
|
}
|
||||||
|
if ($found == 0) {
|
||||||
|
sleep($pingdelay);
|
||||||
|
$pingdelay=$pingdelay*2;
|
||||||
|
if ($pingdelay>1200) {
|
||||||
|
$pingdelay=1200;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user