mirror of https://github.com/scrapy/scrapy.git
restored support for spider.DOWNLOAD_DELAY attribute, with deprecation warning
This commit is contained in:
parent
c8d30c6ffa
commit
e0ec239930
|
|
@ -40,6 +40,10 @@ class Slot(object):
|
|||
|
||||
def _get_concurrency_delay(concurrency, spider, settings):
|
||||
delay = settings.getfloat('DOWNLOAD_DELAY')
|
||||
if hasattr(spider, 'DOWNLOAD_DELAY'):
|
||||
warnings.warn("%s.DOWNLOAD_DELAY attribute is deprecated, use %s.download_delay instead" %
|
||||
(type(spider).__name__, type(spider).__name__))
|
||||
delay = spider.DOWNLOAD_DELAY
|
||||
if hasattr(spider, 'download_delay'):
|
||||
delay = spider.download_delay
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue