|
|
@ -163,6 +163,7 @@ class MySQL { |
|
|
|
return $query->fetch()->total; |
|
|
|
return $query->fetch()->total; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* not in use |
|
|
|
public function getTotalPagesByHttpCode(mixed $httpCode) { |
|
|
|
public function getTotalPagesByHttpCode(mixed $httpCode) { |
|
|
|
|
|
|
|
|
|
|
|
if (is_null($httpCode)) { |
|
|
|
if (is_null($httpCode)) { |
|
|
@ -179,6 +180,7 @@ class MySQL { |
|
|
|
|
|
|
|
|
|
|
|
return $query->fetch()->total; |
|
|
|
return $query->fetch()->total; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
public function getHostPage(int $hostId, int $crc32uri) { |
|
|
|
public function getHostPage(int $hostId, int $crc32uri) { |
|
|
|
|
|
|
|
|
|
|
@ -662,6 +664,21 @@ class MySQL { |
|
|
|
return $query->fetchAll(); |
|
|
|
return $query->fetchAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getHostPageCrawlQueueTotal(int $timeFrom) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM `hostPage` |
|
|
|
|
|
|
|
JOIN `host` ON (`host`.`hostId` = `hostPage`.`hostId`) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WHERE (`hostPage`.`timeUpdated` IS NULL OR `hostPage`.`timeUpdated` < ? ) AND `host`.`status` <> ? |
|
|
|
|
|
|
|
AND `hostPage`.`timeBanned` IS NULL'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$timeFrom, 0]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->fetch()->total; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function updateHostPageCrawlQueue(int $hostPageId, int $timeUpdated, int $httpCode, int $size) { |
|
|
|
public function updateHostPageCrawlQueue(int $hostPageId, int $timeUpdated, int $httpCode, int $size) { |
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('UPDATE `hostPage` SET `timeUpdated` = ?, `httpCode` = ?, `size` = ? WHERE `hostPageId` = ? LIMIT 1'); |
|
|
|
$query = $this->_db->prepare('UPDATE `hostPage` SET `timeUpdated` = ?, `httpCode` = ?, `size` = ? WHERE `hostPageId` = ? LIMIT 1'); |
|
|
|