From 4e5973e8749c19aa75406d9acee387dbde74e92d Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Sun, 31 Dec 2023 22:57:07 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20a=20flaw=20in=20=E2=80=9Cdead=20instanc?= =?UTF-8?q?es=E2=80=9D=20loading=20queries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/clitools/peerscrawl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/clitools/peerscrawl.php b/web/clitools/peerscrawl.php index d099f9c..feda438 100755 --- a/web/clitools/peerscrawl.php +++ b/web/clitools/peerscrawl.php @@ -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))