Use "failed" field

This commit is contained in:
Michael 2020-07-19 11:42:23 +00:00
parent ebcf757244
commit 5bf813d0ec
9 changed files with 22 additions and 24 deletions

View file

@ -58,12 +58,11 @@ class SearchDirectory
if (!empty($j->results)) {
foreach ($j->results as $jj) {
// Check if the contact already exists
$gcontact = DBA::selectFirst('gcontact', ['id', 'last_contact', 'last_failure', 'updated'], ['nurl' => Strings::normaliseLink($jj->url)]);
$gcontact = DBA::selectFirst('gcontact', ['failed'], ['nurl' => Strings::normaliseLink($jj->url)]);
if (DBA::isResult($gcontact)) {
Logger::info('Profile already exists', ['profile' => $jj->url, 'search' => $search]);
if (($gcontact['last_contact'] < $gcontact['last_failure']) &&
($gcontact['updated'] < $gcontact['last_failure'])) {
if ($gcontact['failed']) {
continue;
}