From b929d06302f51444ec467e24b9fc3c55fb7013a8 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Wed, 28 Dec 2022 18:59:09 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20INSERT=20an=20instance=20if=20i?= =?UTF-8?q?t=20did=20not=20respond:=20it=20was=20useful=20before=20instanc?= =?UTF-8?q?e=20=E2=80=9Cdeadness=E2=80=9D=20was=20autonomously=20managed?= =?UTF-8?q?=20by=20peerscrawl.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/clitools/getinstinfo.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/clitools/getinstinfo.php b/web/clitools/getinstinfo.php index 1da9ed2..ed324e6 100755 --- a/web/clitools/getinstinfo.php +++ b/web/clitools/getinstinfo.php @@ -611,7 +611,13 @@ $query.=implode(', ',$set); if (!is_null($oidata)) $query.=' WHERE ID='.$oidata['ID']; eecho(1,'query: «'.$query.'».'.N); -if (!$opts['dryrun']) myq($link,$query,__LINE__); +if (!$opts['dryrun']) { + if (!is_null($oidata) || $instanswered) { + myq($link,$query,__LINE__); + } else { + mexit('«'.$opts['hostname'].'»: not inserting unknown instance because it did not respond; shutting down after '.ght(time()-$now,null,0).' :-)'.N,0); + } +} if (is_null($oidata)) { (!$opts['dryrun']) ? $instid=mysqli_insert_id($link) : $instid=0;