diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-01-17 16:14:16 +0100 |
|---|---|---|
| committer | Alexandre Flament <alex@al-f.net> | 2021-01-18 08:19:44 +0100 |
| commit | d473407ec97107022ccbdd366559001b1ec162d8 (patch) | |
| tree | 8924f2d081963dc7d65b1a4beaeda7214a6874f5 /searx/metrology/error_recorder.py | |
| parent | ca76f3119a4d66cb8aa74829ca5f0a0a72f0f96b (diff) | |
[fix] checker: fix engine statistics
Without this commit, the URL /stats/errors shows percentage above 100% after the checker has run.
Diffstat (limited to 'searx/metrology/error_recorder.py')
| -rw-r--r-- | searx/metrology/error_recorder.py | 4 |
1 files changed, 2 insertions, 2 deletions
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] |