Drop UpdateGServer worker task if domain is blocked

This commit is contained in:
Hypolite Petovan
2023-01-04 11:39:22 -05:00
parent a907d6c87b
commit 1f3c07c06f
3 changed files with 44 additions and 10 deletions
+3 -2
View File
@@ -27,6 +27,7 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use GuzzleHttp\Psr7\Uri;
class UpdateGServers
{
@@ -63,12 +64,12 @@ class UpdateGServers
// There are duplicated "url" but not "nurl". So we check both addresses instead of just overwriting them,
// since that would mean loosing data.
if (!empty($gserver['url'])) {
if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) {
if (UpdateGServer::add(Worker::PRIORITY_LOW, $gserver['url'])) {
$count++;
}
}
if (!empty($gserver['nurl']) && ($gserver['nurl'] != Strings::normaliseLink($gserver['url']))) {
if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) {
if (UpdateGServer::add(Worker::PRIORITY_LOW, $gserver['nurl'])) {
$count++;
}
}