]> git.mxchange.org Git - friendica.git/commitdiff
Added UpdateServerDirectory
authorMichael <heluecht@pirati.ca>
Fri, 20 Dec 2019 20:37:21 +0000 (20:37 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 20 Dec 2019 20:37:21 +0000 (20:37 +0000)
src/Protocol/PortableContact.php
src/Worker/DiscoverPoCo.php
src/Worker/UpdateServerDirectory.php [new file with mode: 0644]

index 228a96762cf718810ea25e136cbbf80192c6b552..655929f52987d2ef5c3a6714658c35d54cae50c0 100644 (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;
index 2c3536bf863ac0c593fef29797060b06801f46d8..47071e20cb2174354b879c3eaf91d8dff16ea6c9 100644 (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;
diff --git a/src/Worker/UpdateServerDirectory.php b/src/Worker/UpdateServerDirectory.php
new file mode 100644 (file)
index 0000000..df87b20
--- /dev/null
@@ -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;
+       }
+}