* Set failed server status
*
* @param string $url
+ * @return void
*/
public static function setFailureByUrl(string $url)
{
$nurl = Strings::normaliseLink($url);
- if (Network::isUrlBlocked($url)) {
- Logger::info('Server domain is blocked', ['url' => $url]);
- return;
- } elseif (Network::isUrlBlocked($nurl)) {
- Logger::info('Server domain is blocked', ['nurl' => $nurl]);
- return;
- }
-
$gserver = DBA::selectFirst('gserver', [], ['nurl' => $nurl]);
if (DBA::isResult($gserver)) {
$next_update = self::getNextUpdateDate(false, $gserver['created'], $gserver['last_contact']);
return;
}
+ if (Network::isUrlBlocked($url)) {
+ Logger::info('Server domain is blocked', ['url' => $url]);
+ return;
+ } elseif (Network::isUrlBlocked($nurl)) {
+ Logger::info('Server domain is blocked', ['nurl' => $nurl]);
+ return;
+ }
+
self::insert(['url' => $url, 'nurl' => $nurl,
'network' => Protocol::PHANTOM, 'created' => DateTimeFormat::utcNow(),
'failed' => true, 'last_failure' => DateTimeFormat::utcNow()]);