Merge pull request #2657 from cyclaero/conditional-sigusr1

Windows does not support SIGUSR1, so don't use it unconditionally.
This commit is contained in:
Noémi Ványi 2021-03-16 20:57:10 +01:00 committed by GitHub
commit 11070e5744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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