mirror of https://github.com/scrapy/scrapy.git
added support for global DOWNLOAD_DELAY setting
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40291
This commit is contained in:
parent
3ec47301e3
commit
58a419f45c
|
|
@ -139,7 +139,7 @@ class Downloader(object):
|
|||
return
|
||||
|
||||
# Instanciate site specific handling based on info provided by spider
|
||||
delay = getattr(spider, 'download_delay', None)
|
||||
delay = getattr(spider, 'download_delay', None) or settings.getint("DOWNLOAD_DELAY", 0)
|
||||
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