summaryrefslogtreecommitdiff
path: root/searx/metrology
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-01-18 08:29:25 +0100
committerGitHub <noreply@github.com>2021-01-18 08:29:25 +0100
commit0495e15df4b5e88adef24a9b5c3dbb35e4fac072 (patch)
tree0199011d65c8783ad4b78abd2770290708ef6751 /searx/metrology
parent80d7411f2cf72b0ba7b72afe85a6703db5ec3525 (diff)
parent67a1aab0d5b8ab93b60be5da2390039f6c861505 (diff)
Merge pull request #2476 from dalf/fix-error-recording-and-checker
Fix error recording and checker
Diffstat (limited to 'searx/metrology')
-rw-r--r--searx/metrology/error_recorder.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/searx/metrology/error_recorder.py b/searx/metrology/error_recorder.py
index 65dbf33c8..f533e4e8b 100644
--- a/searx/metrology/error_recorder.py
+++ b/searx/metrology/error_recorder.py
@@ -51,15 +51,12 @@ def add_error_context(engine_name: str, error_context: ErrorContext) -> None:
def get_trace(traces):
- previous_trace = traces[-1]
for trace in reversed(traces):
- if trace.filename.endswith('searx/search.py'):
- if previous_trace.filename.endswith('searx/poolrequests.py'):
- return trace
- if previous_trace.filename.endswith('requests/models.py'):
- return trace
- return previous_trace
- previous_trace = trace
+ split_filename = trace.filename.split('/')
+ if '/'.join(split_filename[-3:-1]) == 'searx/engines':
+ return trace
+ if '/'.join(split_filename[-4:-1]) == 'searx/search/processors':
+ return trace
return traces[-1]