Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

remove burst limiting

thiswillbeyourgithub0dcdd611ec5f
diff --git a/mwmbl/crawler/README.md b/mwmbl/crawler/README.md
index 7d151ec..4334821 100644
--- a/mwmbl/crawler/README.md
+++ b/mwmbl/crawler/README.md
@@ -23,9 +23,6 @@ The crawler can be configured using the following environment variables:
### Worker Configuration
- `CRAWLER_WORKERS` (default: 10) - Number of parallel crawler worker processes to run
-### Rate Limiting Configuration
-- `CRAWL_DELAY_SECONDS` (default: 0.0) - Delay in seconds between crawl requests to reduce bursting. Change this only if necessary.
-
### Redis Configuration
- `REDIS_URL` (default: 'redis://127.0.0.1:6379') - Redis connection URL for URL queues and stats
diff --git a/mwmbl/crawler/env_vars.py b/mwmbl/crawler/env_vars.py
index 2f507b8..cdd6a46 100644
--- a/mwmbl/crawler/env_vars.py
+++ b/mwmbl/crawler/env_vars.py
@@ -21,8 +21,5 @@ MAX_SITE_URLS = int(os.environ.get('MAX_SITE_URLS', '100'))
# Crawler worker configuration
CRAWLER_WORKERS = int(os.environ.get('CRAWLER_WORKERS', '10'))
-# Rate limiting configuration - delay in seconds between crawl requests to reduce bursting
-CRAWL_DELAY_SECONDS = float(os.environ.get('CRAWL_DELAY_SECONDS', '0.0'))
-
# Redis configuration
REDIS_URL = os.environ.get('REDIS_URL', 'redis://127.0.0.1:6379')
diff --git a/mwmbl/crawler/retrieve.py b/mwmbl/crawler/retrieve.py
index 546a554..5ff014b 100644
--- a/mwmbl/crawler/retrieve.py
+++ b/mwmbl/crawler/retrieve.py
@@ -13,7 +13,7 @@ from urllib3.exceptions import NewConnectionError, MaxRetryError
from mwmbl.justext.core import html_to_dom
from mwmbl.justext.paragraph import Paragraph
-from mwmbl.crawler.env_vars import TIMEOUT_SECONDS, MAX_FETCH_SIZE, MAX_NEW_LINKS, MAX_EXTRA_LINKS, MAX_SITE_URLS, CRAWL_DELAY_SECONDS
+from mwmbl.crawler.env_vars import TIMEOUT_SECONDS, MAX_FETCH_SIZE, MAX_NEW_LINKS, MAX_EXTRA_LINKS, MAX_SITE_URLS
ALLOWED_EXCEPTIONS = (ValueError, ConnectionError, ReadTimeout, TimeoutError,
OSError, NewConnectionError, MaxRetryError, SSLCertVerificationError)
@@ -145,11 +145,6 @@ def get_new_links(paragraphs: list[Paragraph], current_url):
def crawl_url(url):
logger.info(f"Crawling URL {url}")
-
- # Rate limiting to reduce bursting - add delay between requests if configured
- if CRAWL_DELAY_SECONDS > 0:
- time.sleep(CRAWL_DELAY_SECONDS)
-
js_timestamp = int(time.time() * 1000)
allowed = robots_allowed(url)
if not allowed: