periodic_log: interval check moved

This commit is contained in:
Georgiy Zatserklianyi 2023-08-10 21:31:10 +03:00
parent e9b088f1fb
commit f05657e542
1 changed files with 2 additions and 2 deletions

View File

@ -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(