mirror of https://github.com/scrapy/scrapy.git
check CONCURRENT_REQUESTS_PER_IP is not set
This commit is contained in:
parent
987c2ae4a9
commit
8e8ce301b1
|
|
@ -171,6 +171,14 @@ class DownloaderAwarePriorityQueue(SlotBasedPriorityQueue):
|
|||
return cls(crawler, qfactory, startprios)
|
||||
|
||||
def __init__(self, crawler, qfactory, startprios={}):
|
||||
ip_concurrency_key = 'CONCURRENT_REQUESTS_PER_IP'
|
||||
ip_concurrency = crawler.settings.getint(ip_concurrency_key, 0)
|
||||
|
||||
if ip_concurrency > 0:
|
||||
raise ValueError('"%s" does not support %s=%d' % (self.__class__,
|
||||
ip_concurrency_key,
|
||||
ip_concurrency))
|
||||
|
||||
super(DownloaderAwarePriorityQueue, self).__init__(qfactory,
|
||||
startprios)
|
||||
self._slots = {slot: 0 for slot in self.pqueues}
|
||||
|
|
|
|||
Loading…
Reference in New Issue