mirror of https://github.com/scrapy/scrapy.git
allow to set download delay as a scrapy setting
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40255
This commit is contained in:
parent
cfb56e39bb
commit
6ce7ae4df8
|
|
@ -140,7 +140,7 @@ class Downloader(object):
|
|||
return
|
||||
|
||||
# Instanciate site specific handling based on info provided by spider
|
||||
delay = getattr(spider, 'download_delay', None)
|
||||
delay = settings.getint('DOWNLOAD_DELAY', None) or getattr(spider, 'download_delay', None)
|
||||
maxcr = getattr(spider, 'max_concurrent_requests', settings.getint('REQUESTS_PER_DOMAIN'))
|
||||
site = SiteDetails(download_delay=delay, max_concurrent_requests=maxcr)
|
||||
self.sites[domain] = site
|
||||
|
|
|
|||
Loading…
Reference in New Issue