mirror of https://github.com/scrapy/scrapy.git
periodic_log: interval check moved
This commit is contained in:
parent
e9b088f1fb
commit
f05657e542
|
|
@ -37,6 +37,8 @@ class PeriodicLog:
|
|||
@classmethod
|
||||
def from_crawler(cls, crawler):
|
||||
interval = crawler.settings.getfloat("LOGSTATS_INTERVAL")
|
||||
if not interval:
|
||||
raise NotConfigured
|
||||
try:
|
||||
ext_stats = crawler.settings.getdict("PERIODIC_LOG_STATS")
|
||||
except (TypeError, ValueError):
|
||||
|
|
@ -57,8 +59,6 @@ class PeriodicLog:
|
|||
ext_timing_enabled = crawler.settings.getbool(
|
||||
"PERIODIC_LOG_TIMING_ENABLED", False
|
||||
)
|
||||
if not interval:
|
||||
raise NotConfigured
|
||||
if not (ext_stats or ext_delta or ext_timing_enabled):
|
||||
raise NotConfigured
|
||||
o = cls(
|
||||
|
|
|
|||
Loading…
Reference in New Issue