From e16a7b8171a4ebb50bced2f660193150157b052f Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 17 Jun 2023 11:33:32 +0300 Subject: [PATCH] fix HY000/1366 error processing --- crontab/crawler.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crontab/crawler.php b/crontab/crawler.php index 4f9afe6..5e17962 100644 --- a/crontab/crawler.php +++ b/crontab/crawler.php @@ -1005,15 +1005,21 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND // Ban page that throws the data type error and stuck the crawl queue if (!empty($queueHostPage->hostPageId) && !empty($e->errorInfo[0]) && in_array($e->errorInfo[0], ['HY000']) && - !empty($e->errorInfo[1]) && in_array($e->errorInfo[1], [1366])) { // @TODO + !empty($e->errorInfo[1]) && in_array($e->errorInfo[1], [1366])) { // @TODO change DB $hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time()); $hostPagesProcessed++; - } - // Skip item - $db->rollBack(); + // Apply changes + $db->commit(); + + } else { + + // Skip item + $db->rollBack(); + + } continue; }