From 1485983b3abd837930352e7315f9ab7a8239c519 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 2 Apr 2023 00:27:33 +0300 Subject: [PATCH] lock multi-thread execution --- crontab/crawler.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crontab/crawler.php b/crontab/crawler.php index 84cf734..e4dd37b 100644 --- a/crontab/crawler.php +++ b/crontab/crawler.php @@ -1,5 +1,13 @@ getPageQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET) if (!parse_url($src, PHP_URL_HOST)) { $src = parse_url($queue->url, PHP_URL_SCHEME) . '://' . - parse_url($queue->url, PHP_URL_HOST) . - parse_url($queue->url, PHP_URL_PORT) . - $src; // @TODO sometimes wrong URL prefix available + parse_url($queue->url, PHP_URL_HOST) . + parse_url($queue->url, PHP_URL_PORT) . + $src; // @TODO sometimes wrong URL prefix available } // Add page images @@ -132,4 +140,4 @@ foreach ($db->getPageQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET) } } } -} +} \ No newline at end of file