From d473407ec97107022ccbdd366559001b1ec162d8 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sun, 17 Jan 2021 16:14:16 +0100 Subject: [fix] checker: fix engine statistics Without this commit, the URL /stats/errors shows percentage above 100% after the checker has run. --- searx/metrology/error_recorder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searx/metrology/error_recorder.py') diff --git a/searx/metrology/error_recorder.py b/searx/metrology/error_recorder.py index bd8404ad1..f533e4e8b 100644 --- a/searx/metrology/error_recorder.py +++ b/searx/metrology/error_recorder.py @@ -53,9 +53,9 @@ def add_error_context(engine_name: str, error_context: ErrorContext) -> None: def get_trace(traces): for trace in reversed(traces): split_filename = trace.filename.split('/') - if len(split_filename) > 3 and '/'.join(split_filename[-3:-1]) == 'searx/engines': + if '/'.join(split_filename[-3:-1]) == 'searx/engines': return trace - if len(split_filename) > 3 and '/'.join(split_filename[-4:-1]) == 'searx/search/processors': + if '/'.join(split_filename[-4:-1]) == 'searx/search/processors': return trace return traces[-1] -- cgit v1.2.3