]> git.mxchange.org Git - friendica.git/commitdiff
"CheckServer" is now "UpdateGServer"
authorMichael <heluecht@pirati.ca>
Sat, 21 Dec 2019 18:11:51 +0000 (18:11 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 21 Dec 2019 18:11:51 +0000 (18:11 +0000)
src/Protocol/PortableContact.php
src/Worker/CheckServer.php [deleted file]
src/Worker/UpdateGServer.php [new file with mode: 0644]
src/Worker/UpdateServers.php

index d720910c5fb2ec82ab4af17ffab320c1ac135f10..49da85e6150eae01fd6f7fa4524feaa43c59ad1f 100644 (file)
@@ -270,7 +270,7 @@ class PortableContact
 
                        if (!DBA::isResult($r)) {
                                Logger::log("Call server check for server ".$server_url, Logger::DEBUG);
-                               Worker::add(PRIORITY_LOW, 'CheckServer', $server_url);
+                               Worker::add(PRIORITY_LOW, 'UpdateGServer', $server_url);
                        }
                }
        }
@@ -295,7 +295,7 @@ class PortableContact
 
                        if (!empty($servers['pods'])) {
                                foreach ($servers['pods'] as $server) {
-                                       Worker::add(PRIORITY_LOW, 'CheckServer', 'https://' . $server['host']);
+                                       Worker::add(PRIORITY_LOW, 'UpdateGServer', 'https://' . $server['host']);
                                }
                        }
                }
@@ -314,7 +314,7 @@ class PortableContact
 
                                        foreach ($servers['instances'] as $server) {
                                                $url = (is_null($server['https_score']) ? 'http' : 'https') . '://' . $server['name'];
-                                               Worker::add(PRIORITY_LOW, 'CheckServer', $url);
+                                               Worker::add(PRIORITY_LOW, 'UpdateGServer', $url);
                                        }
                                }
                        }
diff --git a/src/Worker/CheckServer.php b/src/Worker/CheckServer.php
deleted file mode 100644 (file)
index ad78d7d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * @file src/Worker/CheckServer.php
- */
-namespace Friendica\Worker;
-
-use Friendica\Core\Logger;
-use Friendica\Model\GServer;
-use Friendica\Util\Strings;
-
-class CheckServer
-{
-       // Searches for the poco server list.
-       public static function execute($server_url)
-       {
-               if (empty($server_url)) {
-                       return;
-               }
-
-               $server_url = filter_var($server_url, FILTER_SANITIZE_URL);
-               if (substr(Strings::normaliseLink($server_url), 0, 7) != 'http://') {
-                       return;
-               }
-
-               $ret = GServer::check($server_url);
-               Logger::info('Checked server', ['url' => $server_url, 'result' => $ret]);
-       }
-}
diff --git a/src/Worker/UpdateGServer.php b/src/Worker/UpdateGServer.php
new file mode 100644 (file)
index 0000000..2e01742
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file src/Worker/UpdateGServer.php
+ */
+namespace Friendica\Worker;
+
+use Friendica\Core\Logger;
+use Friendica\Model\GServer;
+use Friendica\Util\Strings;
+
+class UpdateGServer
+{
+       // Searches for the poco server list.
+       public static function execute($server_url)
+       {
+               if (empty($server_url)) {
+                       return;
+               }
+
+               $server_url = filter_var($server_url, FILTER_SANITIZE_URL);
+               if (substr(Strings::normaliseLink($server_url), 0, 7) != 'http://') {
+                       return;
+               }
+
+               $ret = GServer::check($server_url);
+               Logger::info('Updated gserver', ['url' => $server_url, 'result' => $ret]);
+       }
+}
index d3ce3fca77a8f6c03d89bd85dfc82c8b714a452f..d1cc04209a589eba5ed96791818900bb56e5c774 100644 (file)
@@ -30,7 +30,7 @@ class UpdateServers
                        }
                        Logger::info('Update server status', ['server' => $gserver['url']]);
 
-                       Worker::add(PRIORITY_LOW, 'CheckServer', $gserver['url']);
+                       Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['url']);
 
                        if (++$updated > 250) {
                                return;