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/search/checker/impl.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'searx/search/checker/impl.py') diff --git a/searx/search/checker/impl.py b/searx/search/checker/impl.py index 71a941f73..244536f1b 100644 --- a/searx/search/checker/impl.py +++ b/searx/search/checker/impl.py @@ -4,6 +4,7 @@ import typing import types import functools import itertools +import threading from time import time from urllib.parse import urlparse @@ -377,6 +378,8 @@ class Checker: engineref_category = search_query.engineref_list[0].category params = self.processor.get_params(search_query, engineref_category) if params is not None: + with threading.RLock(): + self.processor.engine.stats['sent_search_count'] += 1 self.processor.search(search_query.query, params, result_container, time(), 5) return result_container -- cgit v1.2.3