Added regexps check before adding an inst to “Instances” and “Peers” tables
This commit is contained in:
parent
738fa8c864
commit
943c65b2ba
1 changed files with 34 additions and 30 deletions
|
@ -289,9 +289,10 @@ function crawl(&$list,$id) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!ckexarr($inst)) {
|
||||
$responded=false;
|
||||
lecho(1,'trying to load «'.$inst.'»’s instance info...'.N);
|
||||
$instinfo=gurl('https://'.$inst.'/api/v1/instance/peers',$opts['timeout'],$opts['curltimeout']);
|
||||
$instinfo=gurl('https://'.$inst.'/api/v1/instance',$opts['timeout'],$opts['curltimeout']);
|
||||
if ($instinfo['cont']===false) {
|
||||
lecho(2,'could not load «'.$inst.'»’s instance info: '.$instinfo['emsg'].'.'.N);
|
||||
} else {
|
||||
|
@ -322,6 +323,9 @@ function crawl(&$list,$id) {
|
|||
if ($responded) $query.=', LastOkCheckTS='.$now;
|
||||
myq($link,$query);
|
||||
}
|
||||
} else {
|
||||
lecho(2,'ignoring instance «'.$inst.'» because it matches an exclusion regexp: won’t add it to «Instances» and «Peers» tables.'.N);
|
||||
}
|
||||
}
|
||||
unset($list);
|
||||
if (count($nlist)>0) {
|
||||
|
|
Loading…
Reference in a new issue