Don’t INSERT an instance if it did not respond: it was useful before instance “deadness” was autonomously managed by peerscrawl.php

This commit is contained in:
pezcurrel 2022-12-28 18:59:09 +01:00
parent e7eb303094
commit b929d06302

View file

@ -611,7 +611,13 @@ $query.=implode(', ',$set);
if (!is_null($oidata)) $query.=' WHERE ID='.$oidata['ID']; if (!is_null($oidata)) $query.=' WHERE ID='.$oidata['ID'];
eecho(1,'query: «'.$query.'».'.N); 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)) { if (is_null($oidata)) {
(!$opts['dryrun']) ? $instid=mysqli_insert_id($link) : $instid=0; (!$opts['dryrun']) ? $instid=mysqli_insert_id($link) : $instid=0;