fix: Re-added peeringdb back into daily.sh (#7884)

This commit is contained in:
Neil Lathwood
2017-12-09 17:19:56 +00:00
committed by GitHub
parent ab2aacec0f
commit 2c919a48ff
2 changed files with 5 additions and 1 deletions

View File

@@ -226,6 +226,10 @@ main () {
local options=("notifications");
call_daily_php "${options[@]}";
;;
peeringdb)
local options=("peeringdb");
call_daily_php "${options[@]}";
;;
esac
fi
}

View File

@@ -2282,7 +2282,7 @@ function cache_peeringdb()
// We cache for 71 hours
$cached = dbFetchCell("SELECT count(*) FROM `pdb_ix` WHERE (UNIX_TIMESTAMP() - timestamp) < 255600");
if ($cached == 0) {
$rand = rand(30, 600);
$rand = rand(3, 30);
echo "No cached PeeringDB data found, sleeping for $rand seconds" . PHP_EOL;
sleep($rand);
foreach (dbFetchRows("SELECT `bgpLocalAs` FROM `devices` WHERE `disabled` = 0 AND `ignore` = 0 AND `bgpLocalAs` > 0 AND (`bgpLocalAs` < 64512 OR `bgpLocalAs` > 65535) AND `bgpLocalAs` < 4200000000 GROUP BY `bgpLocalAs`") as $as) {