summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoémi Ványi <kvch@users.noreply.github.com>2021-03-16 20:57:10 +0100
committerGitHub <noreply@github.com>2021-03-16 20:57:10 +0100
commit11070e57449caf86fd6087116e24bed8bea54e63 (patch)
tree523de9cfebdb4e73445f317880187c6dd532ebba
parentcb3b379161e3351d4829b2e37478125582b9fc08 (diff)
parent7a9dc63d74929f657170a43b269529a028e64a93 (diff)
downloadsearxng-11070e57449caf86fd6087116e24bed8bea54e63.tar.gz
searxng-11070e57449caf86fd6087116e24bed8bea54e63.zip
Merge pull request #2657 from cyclaero/conditional-sigusr1
Windows does not support SIGUSR1, so don't use it unconditionally.
-rw-r--r--searx/search/checker/background.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py
index 22a51b8bb..c3292d9ac 100644
--- a/searx/search/checker/background.py
+++ b/searx/search/checker/background.py
@@ -94,8 +94,10 @@ def _signal_handler(signum, frame):
def initialize():
- logger.info('Send SIGUSR1 signal to pid %i to start the checker', os.getpid())
- signal.signal(signal.SIGUSR1, _signal_handler)
+ if hasattr(signal, 'SIGUSR1'):
+ # Windows doesn't support SIGUSR1
+ logger.info('Send SIGUSR1 signal to pid %i to start the checker', os.getpid())
+ signal.signal(signal.SIGUSR1, _signal_handler)
# disabled by default
_set_result({'status': 'disabled'}, include_timestamp=False)