X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FPullDirectory.php;h=8592105b24b998388c3f002e76f77635e80c0b36;hb=3f523a88b0af4e2a73b29917da33d221abef9647;hp=a83b0a13be383e7615c03e17a522054c78c5f749;hpb=ca2267a4a6d9a15bb52fcc7ee961ecffe25db098;p=friendica.git diff --git a/src/Worker/PullDirectory.php b/src/Worker/PullDirectory.php index a83b0a13be..8592105b24 100644 --- a/src/Worker/PullDirectory.php +++ b/src/Worker/PullDirectory.php @@ -22,7 +22,6 @@ namespace Friendica\Worker; use Friendica\Core\Logger; -use Friendica\Core\Worker; use Friendica\DI; use Friendica\Model\Contact; @@ -60,22 +59,11 @@ class PullDirectory return; } + $result = Contact::addByUrls($contacts['results']); + $now = $contacts['now'] ?? 0; - $count = $contacts['count'] ?? 0; - $added = 0; - $updated = 0; - foreach ($contacts['results'] as $url) { - $contact = Contact::getByURL($url, false, ['id']); - if (empty($contact['id'])) { - Worker::add(PRIORITY_LOW, 'AddContact', 0, $url); - ++$added; - } else { - Worker::add(PRIORITY_LOW, "UpdateContact", $contact['id']); - ++$updated; - } - } DI::config()->set('system', 'last-directory-sync', $now); - Logger::info('Synchronization ended.', ['now' => $now, 'count' => $count, 'added' => $added, 'updated' => $updated, 'directory' => $directory]); + Logger::info('Synchronization ended', ['now' => $now, 'count' => $result['count'], 'added' => $result['added'], 'updated' => $result['updated'], 'unchanged' => $result['unchanged'], 'directory' => $directory]); } }