X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FPullDirectory.php;h=d174d11f3e5d36a67b898f5d2883667b3f9dff73;hb=b227d65dfc086c4d61e471360c09a34abf21a301;hp=2cf084124690d93126b8f47a5d4358296c6e1717;hpb=e299fc67c8809ecf1018e6680a3a5284bcf7d8d9;p=friendica.git diff --git a/src/Worker/PullDirectory.php b/src/Worker/PullDirectory.php index 2cf0841246..d174d11f3e 100644 --- a/src/Worker/PullDirectory.php +++ b/src/Worker/PullDirectory.php @@ -22,6 +22,7 @@ namespace Friendica\Worker; use Friendica\Core\Logger; +use Friendica\Core\Search; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Network\HTTPClient\Client\HttpClientAccept; @@ -38,13 +39,13 @@ class PullDirectory return; } - $directory = DI::config()->get('system', 'directory'); + $directory = Search::getGlobalDirectory(); if (empty($directory)) { Logger::info('No directory configured'); return; } - $now = (int)DI::config()->get('system', 'last-directory-sync', 0); + $now = (int)(DI::keyValue()->get('last-directory-sync') ?? 0); Logger::info('Synchronization started.', ['now' => $now, 'directory' => $directory]); @@ -63,7 +64,7 @@ class PullDirectory $result = Contact::addByUrls($contacts['results']); $now = $contacts['now'] ?? 0; - DI::config()->set('system', 'last-directory-sync', $now); + DI::keyValue()->set('last-directory-sync', $now); Logger::info('Synchronization ended', ['now' => $now, 'count' => $result['count'], 'added' => $result['added'], 'updated' => $result['updated'], 'unchanged' => $result['unchanged'], 'directory' => $directory]); }