Fixed a flaw in “dead instances” loading queries
This commit is contained in:
parent
417803a76d
commit
4e5973e874
1 changed files with 2 additions and 2 deletions
|
@ -201,12 +201,12 @@ $deadinsts=[];
|
|||
if ($opts['excludedead']) {
|
||||
$graceline=time()-$opts['gracetime'];
|
||||
lecho(1,'loading dead instances from “Instances” and “Peers” table (gracetime: '.ght($opts['gracetime'],null,0).'; graceline: '.date('Y-m-d H:i:s',$graceline).').'.N);
|
||||
$res=myq($link,'SELECT URI FROM Instances WHERE LastOkCheckTS<'.$graceline.' OR (LastOkCheckTS IS NULL AND InsertTS<'.$graceline.')');
|
||||
$res=myq($link,'SELECT URI FROM Instances WHERE LastOkCheckTS<'.$graceline.' OR LastOkCheckTS IS NULL');
|
||||
lecho(1,'got '.mysqli_num_rows($res).' dead instances from “Instances” table.'.N);
|
||||
while ($row=mysqli_fetch_assoc($res))
|
||||
if (!in_array($row['URI'],$deadinsts))
|
||||
$deadinsts[]=$row['URI'];
|
||||
$res=myq($link,'SELECT Hostname FROM Peers WHERE LastOkCheckTS<'.$graceline.' OR (LastOkCheckTS IS NULL AND FirstCheckTS<'.$graceline.')');
|
||||
$res=myq($link,'SELECT Hostname FROM Peers WHERE LastOkCheckTS<'.$graceline.' OR LastOkCheckTS IS NULL');
|
||||
lecho(1,'got '.mysqli_num_rows($res).' dead instances from “Peers” table.'.N);
|
||||
while ($row=mysqli_fetch_assoc($res))
|
||||
if (!in_array($row['Hostname'],$deadinsts))
|
||||
|
|
Loading…
Reference in a new issue