X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateGServers.php;h=25a2db16e0f8ac22b5bc95f98f698a4558c7c6b9;hb=33c9d17bdbf38d0e290af8ebac6980c52a630956;hp=22635e7341618f9088d8d5c9fa36602959ce612c;hpb=e56a53647bd5469551bf4f9ef2df50a5dd16b943;p=friendica.git diff --git a/src/Worker/UpdateGServers.php b/src/Worker/UpdateGServers.php index 22635e7341..25a2db16e0 100644 --- a/src/Worker/UpdateGServers.php +++ b/src/Worker/UpdateGServers.php @@ -25,6 +25,7 @@ use Friendica\Core\Logger; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; class UpdateGServers @@ -47,7 +48,7 @@ class UpdateGServers } $total = DBA::count('gserver'); - $condition = ["`next_contact` < UTC_TIMESTAMP() AND (`nurl` != ? OR `url` != ?)", '', '']; + $condition = ["`next_contact` < ? AND (`nurl` != ? OR `url` != ?)", DateTimeFormat::utcNow(), '', '']; $outdated = DBA::count('gserver', $condition); Logger::info('Server status', ['total' => $total, 'outdated' => $outdated, 'updating' => $limit]); @@ -62,15 +63,16 @@ 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(PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) { + if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) { $count++; } } if (!empty($gserver['nurl']) && ($gserver['nurl'] != Strings::normaliseLink($gserver['url']))) { - if (Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) { + if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) { $count++; } } + Worker::coolDown(); } DBA::close($gservers); Logger::info('Updated servers', ['count' => $count]);