mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-25 10:43:49 +00:00
Disable CloseSpider extension if no CLOSPIDER_* setting set
This commit is contained in:
parent
a7b86137d0
commit
6ee8d8650a
@ -9,6 +9,7 @@ from collections import defaultdict
|
||||
from twisted.internet import reactor
|
||||
|
||||
from scrapy import signals
|
||||
from scrapy.exceptions import NotConfigured
|
||||
|
||||
|
||||
class CloseSpider(object):
|
||||
@ -23,6 +24,9 @@ class CloseSpider(object):
|
||||
'errorcount': crawler.settings.getint('CLOSESPIDER_ERRORCOUNT'),
|
||||
}
|
||||
|
||||
if not any(self.close_on.values()):
|
||||
raise NotConfigured
|
||||
|
||||
self.counter = defaultdict(int)
|
||||
|
||||
if self.close_on.get('errorcount'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user