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);
}
}
}
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']);
}
}
}
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);
}
}
}
+++ /dev/null
-<?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]);
- }
-}
--- /dev/null
+<?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]);
+ }
+}
}
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;