mirror of https://github.com/scrapy/scrapy.git
per_slot_settings(docs): per slot settings - the highest priority
This commit is contained in:
parent
474087be6f
commit
98a5958687
|
|
@ -102,13 +102,13 @@ class Downloader:
|
|||
key = self._get_slot_key(request, spider)
|
||||
if key not in self.slots:
|
||||
slot_settings = self.per_slot_settings.get(key, {})
|
||||
conc = slot_settings.get(
|
||||
'concurrency', (
|
||||
self.ip_concurrency if self.ip_concurrency else self.domain_concurrency
|
||||
)
|
||||
)
|
||||
conc = (
|
||||
self.ip_concurrency if self.ip_concurrency else self.domain_concurrency)
|
||||
conc, delay = _get_concurrency_delay(conc, spider, self.settings)
|
||||
delay = slot_settings.get('delay', delay)
|
||||
conc, delay = (
|
||||
slot_settings.get('concurrency', conc),
|
||||
slot_settings.get('delay', delay)
|
||||
)
|
||||
randomize_delay = slot_settings.get('randomize_delay', self.randomize_delay)
|
||||
new_slot = Slot(conc, delay, randomize_delay)
|
||||
self.slots[key] = new_slot
|
||||
|
|
|
|||
Loading…
Reference in New Issue