Added UpdateServerDirectory

This commit is contained in:
Michael 2019-12-20 20:37:21 +00:00
parent 37f0519514
commit a1ad549e0b
3 changed files with 19 additions and 4 deletions

View file

@ -488,7 +488,7 @@ class PortableContact
}
Logger::log('Update directory from server ' . $gserver['url'] . ' with ID ' . $gserver['id'], Logger::DEBUG);
Worker::add(PRIORITY_LOW, 'DiscoverPoCo', 'update_server_directory', (int) $gserver['id']);
Worker::add(PRIORITY_LOW, 'UpdateServerDirectory', (int)$gserver['id']);
if (!$complete && ( --$no_of_queries == 0)) {
break;

View file

@ -30,7 +30,6 @@ class DiscoverPoCo
- suggestions: Discover other servers for their contacts.
- server <poco url>: Searches for the poco server list. "poco url" is base64 encoded.
- update_server: Frequently check the first 250 servers for vitality.
- update_server_directory: Discover the given server id for their contacts
- PortableContact::load: Load POCO data from a given POCO address
*/
@ -59,8 +58,6 @@ class DiscoverPoCo
Logger::log($result, Logger::DEBUG);
} elseif ($command == "update_server") {
self::updateServer();
} elseif ($command == "update_server_directory") {
PortableContact::discoverSingleServer(intval($param1));
} elseif ($command == "load") {
if (!empty($param4)) {
$url = $param4;

View file

@ -0,0 +1,18 @@
<?php
/**
* @file src/Worker/UpdateServerDirectory.php
*/
namespace Friendica\Worker;
use Friendica\Core\Logger;
use Friendica\Protocol\PortableContact;
class UpdateServerDirectory.php
{
// Discover the given server id for their contacts
public static function execute($gserverid)
{
PortableContact::discoverSingleServer(gserverid);
return;
}
}