9from typing
import Any, Dict, List, Literal, Optional, Tuple, TypedDict, Union
66 if isinstance(every, int):
70 not isinstance(every, (tuple, list))
72 or not isinstance(every[0], int)
73 or not isinstance(every[1], int)
76 return (every[0], every[1])
136 if hasattr(signal,
'SIGUSR1'):
138 logger.info(
'Send SIGUSR1 signal to pid %i to start the checker', os.getpid())
139 signal.signal(signal.SIGUSR1, _signal_handler)
142 if searx_debug
and settings[
'checker'][
'off_when_debug']:
143 logger.info(
'debug mode: checker is disabled')
147 scheduling = settings[
'checker'][
'scheduling']
148 if scheduling
is None or not scheduling:
149 logger.info(
'Checker scheduler is disabled')
153 if get_redis_client()
is None:
154 logger.error(
'The checker requires Redis')
158 every_range =
_get_interval(scheduling.get(
'every', (300, 1800)),
'checker.scheduling.every is not a int or list')
160 scheduling.get(
'start_after', (300, 1800)),
'checker.scheduling.start_after is not a int or list'
162 t = threading.Thread(
163 target=scheduler_function,
164 args=(start_after_range[0], start_after_range[1], every_range[0], every_range[1], run),
165 name=
'checker_scheduler',