1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-25 11:24:24 +00:00

Disable CloseSpider extension if no CLOSPIDER_* setting set

This commit is contained in:
Paul Tremberth 2016-01-26 13:08:42 +01:00
parent a7b86137d0
commit 6ee8d8650a

View File

@ -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'):