mirror of
https://github.com/friendica/friendica
synced 2025-04-28 03:50:17 +00:00
Asynchronously add contacts to avoid timeout problems
This commit is contained in:
parent
6347578978
commit
4f362f6693
2 changed files with 25 additions and 1 deletions
24
src/Worker/AddContact.php
Normal file
24
src/Worker/AddContact.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file src/Worker/AddContact.php
|
||||
*/
|
||||
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Model\Contact;
|
||||
|
||||
class AddContact
|
||||
{
|
||||
/**
|
||||
* Add contact data via probe
|
||||
* @param int $uid User ID
|
||||
* @param string $url Contact link
|
||||
*/
|
||||
public static function execute(int $uid, string $url)
|
||||
{
|
||||
$result = Contact::createFromProbe($uid, $url, '', false);
|
||||
Logger::info('Added contact', ['uid' => $uid, 'url' => $url, 'result' => $result]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue