Add deprecation warning on download_delay to scrapy/core/downloader/__init__.py

This commit is contained in:
Hok Kan Cheung 2025-12-15 09:32:46 -05:00
parent 9bd7c108e3
commit 3d3c84ceb4
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ def _get_concurrency_delay(
concurrency: int, spider: Spider, settings: BaseSettings
) -> tuple[int, float]:
delay: float = settings.getfloat("DOWNLOAD_DELAY")
if hasattr(spider, "download_delay"):
if hasattr(spider, "download_delay"): # pragma: no cover
warn_on_deprecated_spider_attribute("download_delay", "DOWNLOAD_DELAY")
delay = spider.download_delay
if hasattr(spider, "max_concurrent_requests"): # pragma: no cover