diff options
author | Alexandre Flament <alex@al-f.net> | 2021-01-18 08:29:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 08:29:25 +0100 |
commit | 0495e15df4b5e88adef24a9b5c3dbb35e4fac072 (patch) | |
tree | 0199011d65c8783ad4b78abd2770290708ef6751 /searx/search | |
parent | 80d7411f2cf72b0ba7b72afe85a6703db5ec3525 (diff) | |
parent | 67a1aab0d5b8ab93b60be5da2390039f6c861505 (diff) | |
download | searxng-0495e15df4b5e88adef24a9b5c3dbb35e4fac072.tar.gz searxng-0495e15df4b5e88adef24a9b5c3dbb35e4fac072.zip |
Merge pull request #2476 from dalf/fix-error-recording-and-checker
Fix error recording and checker
Diffstat (limited to 'searx/search')
-rw-r--r-- | searx/search/checker/background.py | 2 | ||||
-rw-r--r-- | searx/search/checker/impl.py | 3 | ||||
-rw-r--r-- | searx/search/processors/abstract.py | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py index e41bff5f5..22a51b8bb 100644 --- a/searx/search/checker/background.py +++ b/searx/search/checker/background.py @@ -98,7 +98,7 @@ def initialize(): signal.signal(signal.SIGUSR1, _signal_handler) # disabled by default - _set_result({'status': 'disabled'}) + _set_result({'status': 'disabled'}, include_timestamp=False) # special case when debug is activate if searx_debug and settings.get('checker', {}).get('off_when_debug', True): 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 diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index eb8d296ec..3a853d49e 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -1,13 +1,13 @@ # SPDX-License-Identifier: AGPL-3.0-or-later -from abc import abstractmethod +from abc import abstractmethod, ABC from searx import logger logger = logger.getChild('searx.search.processor') -class EngineProcessor: +class EngineProcessor(ABC): def __init__(self, engine, engine_name): self.engine = engine |