add hostPage.size collection

This commit is contained in:
ghost 2023-06-13 12:45:12 +03:00
parent 830e96b03d
commit ab78e17ca8
4 changed files with 4 additions and 4 deletions

View File

@ -282,7 +282,7 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND
$httpRequestsTimeTotal += $curl->getTotalTime();
// Update page index anyway, with the current time and http code
$hostPagesProcessed += $db->updateHostPageCrawlQueue($queueHostPage->hostPageId, time(), $curl->getCode());
$hostPagesProcessed += $db->updateHostPageCrawlQueue($queueHostPage->hostPageId, time(), $curl->getCode(), $curl->getSizeDownload());
// This page has on 200 code
if (200 != $curl->getCode()) {

Binary file not shown.

View File

@ -616,11 +616,11 @@ class MySQL {
return $query->fetchAll();
}
public function updateHostPageCrawlQueue(int $hostPageId, int $timeUpdated, int $httpCode) {
public function updateHostPageCrawlQueue(int $hostPageId, int $timeUpdated, int $httpCode, int $size) {
$query = $this->_db->prepare('UPDATE `hostPage` SET `timeUpdated` = ?, `httpCode` = ? WHERE `hostPageId` = ? LIMIT 1');
$query = $this->_db->prepare('UPDATE `hostPage` SET `timeUpdated` = ?, `httpCode` = ?, `size` = ? WHERE `hostPageId` = ? LIMIT 1');
$query->execute([$timeUpdated, $httpCode, $hostPageId]);
$query->execute([$timeUpdated, $httpCode, $size, $hostPageId]);
return $query->rowCount();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB