Shut down server on SIGINT on Windows

select.select blocks SIGINT on Windows.
This commit is contained in:
Unrud 2017-07-30 11:27:08 +02:00
parent d34ee1217d
commit 6d39a61a51

View File

@ -246,8 +246,8 @@ def serve(configuration, logger):
# Use socket pair to get notified of program shutdown # Use socket pair to get notified of program shutdown
sockets.append(shutdown_program_socket_out) sockets.append(shutdown_program_socket_out)
select_timeout = None select_timeout = None
else: if not shutdown_program_socket_out or os.name == "nt":
# Fallback to busy waiting # Fallback to busy waiting. (select.select blocks SIGINT on Windows.)
select_timeout = 1.0 select_timeout = 1.0
if configuration.getboolean("server", "daemon"): if configuration.getboolean("server", "daemon"):
daemonize(configuration, logger) daemonize(configuration, logger)