[fix] checker: fix engine statistics

Without this commit, the URL /stats/errors shows percentage above 100% after the checker has run.
This commit is contained in:
Alexandre Flament 2021-01-17 16:14:16 +01:00
parent ca76f3119a
commit d473407ec9
3 changed files with 7 additions and 4 deletions

View file

@ -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