]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateServerPeers.php
Move notification to the new paradigm
[friendica.git] / src / Worker / UpdateServerPeers.php
index ff0cdfa730d7446cb8dc491908a8b033ee6e137f..e058506b8636359ef08af691145b09ca08f69809 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,9 +22,9 @@
 namespace Friendica\Worker;
 
 use Friendica\Core\Logger;
-use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Model\GServer;
 use Friendica\Util\Strings;
 
 class UpdateServerPeers
@@ -35,7 +35,7 @@ class UpdateServerPeers
         */
        public static function execute(string $url)
        {
-               $ret = DI::httpRequest()->get($url . '/api/v1/instance/peers');
+               $ret = DI::httpClient()->get($url . '/api/v1/instance/peers');
                if (!$ret->isSuccess() || empty($ret->getBody())) {
                        Logger::info('Server is not reachable or does not offer the "peers" endpoint', ['url' => $url]);
                        return;
@@ -58,7 +58,7 @@ class UpdateServerPeers
                                continue;
                        }
                        // This endpoint doesn't offer the schema. So we assume that it is HTTPS.
-                       Worker::add(PRIORITY_LOW, 'UpdateGServer', 'https://' . $peer);
+                       GServer::add('https://' . $peer);
                        ++$added;
                }
                Logger::info('Server peer update ended', ['total' => $total, 'added' => $added, 'url' => $url]);