Remove url caching, locking cleanup

This commit is contained in:
Michael 2020-08-06 18:53:45 +00:00
parent c0aebd2bd4
commit f09d9bc9cc
11 changed files with 55 additions and 73 deletions

View file

@ -168,7 +168,7 @@ class Cron
$oldest_id = $contact['id'];
$oldest_date = $contact['last-update'];
}
Worker::add(PRIORITY_LOW, "UpdateContact", $contact['id'], 'force');
Worker::add(PRIORITY_LOW, "UpdateContact", $contact['id']);
++$count;
}
Logger::info('Initiated update for public contacts', ['interval' => $count, 'id' => $oldest_id, 'oldest' => $oldest_date]);

View file

@ -61,12 +61,12 @@ class OnePoll
}
if (($contact['network'] != Protocol::MAIL) || $force) {
Contact::updateFromProbe($contact_id, '', $force);
Contact::updateFromProbe($contact_id);
}
// Special treatment for wrongly detected local contacts
if (!$force && ($contact['network'] != Protocol::DFRN) && Contact::isLocalById($contact_id)) {
Contact::updateFromProbe($contact_id, Protocol::DFRN, true);
Contact::updateFromProbe($contact_id, Protocol::DFRN);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id]);
}

View file

@ -29,14 +29,11 @@ class UpdateContact
/**
* Update contact data via probe
* @param int $contact_id Contact ID
* @param string $command
*/
public static function execute($contact_id, $command = '')
public static function execute($contact_id)
{
$force = ($command == "force");
$success = Contact::updateFromProbe($contact_id);
$success = Contact::updateFromProbe($contact_id, '', $force);
Logger::info('Updated from probe', ['id' => $contact_id, 'force' => $force, 'success' => $success]);
Logger::info('Updated from probe', ['id' => $contact_id, 'success' => $success]);
}
}