added support for global DOWNLOAD_DELAY setting

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40291
This commit is contained in:
olveyra 2008-10-02 19:59:51 +00:00
parent 3ec47301e3
commit 58a419f45c
1 changed files with 1 additions and 1 deletions

View File

@ -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