mirror of
https://github.com/friendica/friendica
synced 2025-05-15 06:24:11 +02:00
New contact field "updated", fix warnings
This commit is contained in:
parent
a2ca14def4
commit
90eea919a4
3 changed files with 37 additions and 15 deletions
|
@ -8,12 +8,21 @@ namespace Friendica\Worker;
|
|||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Database\DBA;
|
||||
|
||||
class UpdateContact
|
||||
{
|
||||
public static function execute($contact_id)
|
||||
{
|
||||
$success = Contact::updateFromProbe($contact_id);
|
||||
// Update the "updated" field if the contact could be probed.
|
||||
// We don't do this in the function above, since we don't want to
|
||||
// update the contact whenever that function is called from anywhere.
|
||||
if ($success) {
|
||||
DBA::update('contact', ['updated' => DateTimeFormat::utcNow()], ['id' => $contact_id]);
|
||||
}
|
||||
|
||||
Logger::info('Updated from probe', ['id' => $contact_id, 'success' => $success]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue