News "blocked" field on the gserver table

This commit is contained in:
Michael
2023-01-17 17:25:19 +00:00
parent d63aca97b8
commit 356a2a9a5a
14 changed files with 140 additions and 15 deletions

View File

@@ -27,6 +27,7 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\GServer;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Util\Network;
use Friendica\Util\Strings;
class UpdateServerPeers
@@ -56,6 +57,11 @@ class UpdateServerPeers
$total = 0;
$added = 0;
foreach ($peers as $peer) {
if (Network::isUrlBlocked('http://' . $peer)) {
// Ignore blocked systems as soon as possible in the loop to avoid being slowed down by tar pits
continue;
}
++$total;
if (DBA::exists('gserver', ['nurl' => Strings::normaliseLink('http://' . $peer)])) {
// We already know this server