mirror of
https://github.com/friendica/friendica
synced 2025-04-25 20:30:11 +00:00
workerqueue now has a "command" field
This commit is contained in:
parent
aa4372447a
commit
edbdfbae6b
7 changed files with 145 additions and 55 deletions
|
@ -32,18 +32,19 @@ class UpdateGServer
|
|||
* @param string $server_url Server URL
|
||||
* @param boolean $only_nodeinfo Only use nodeinfo for server detection
|
||||
*/
|
||||
public static function execute(string $server_url, bool $only_nodeinfo = false)
|
||||
public static function execute(string $server_url, bool $only_nodeinfo = false, bool $force = false)
|
||||
{
|
||||
if (empty($server_url)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$server_url = filter_var($server_url, FILTER_SANITIZE_URL);
|
||||
if (substr(Strings::normaliseLink($server_url), 0, 7) != 'http://') {
|
||||
$filtered = filter_var($server_url, FILTER_SANITIZE_URL);
|
||||
if (substr(Strings::normaliseLink($filtered), 0, 7) != 'http://') {
|
||||
GServer::setFailure($filtered);
|
||||
return;
|
||||
}
|
||||
|
||||
$ret = GServer::check($server_url, '', false, $only_nodeinfo);
|
||||
Logger::info('Updated gserver', ['url' => $server_url, 'result' => $ret]);
|
||||
$ret = GServer::check($filtered, '', $force, $only_nodeinfo);
|
||||
Logger::info('Updated gserver', ['url' => $filtered, 'result' => $ret]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue