close #185
This commit is contained in:
parent
ab74c010fd
commit
f677c8152d
2 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ def main():
|
|||
logging.warn('received SIGQUIT, doing graceful shutting down..')
|
||||
tcp_server.close(next_tick=True)
|
||||
udp_server.close(next_tick=True)
|
||||
signal.signal(signal.SIGQUIT, handler)
|
||||
signal.signal(getattr(signal, 'SIGQUIT', signal.SIGTERM), handler)
|
||||
loop.run()
|
||||
except (KeyboardInterrupt, IOError, OSError) as e:
|
||||
logging.error(e)
|
||||
|
|
|
@ -71,7 +71,7 @@ def main():
|
|||
def child_handler(signum, _):
|
||||
logging.warn('received SIGQUIT, doing graceful shutting down..')
|
||||
map(lambda s: s.close(next_tick=True), tcp_servers + udp_servers)
|
||||
signal.signal(signal.SIGQUIT, child_handler)
|
||||
signal.signal(getattr(signal, 'SIGQUIT', signal.SIGTERM), child_handler)
|
||||
try:
|
||||
loop = eventloop.EventLoop()
|
||||
dns_resolver.add_to_loop(loop)
|
||||
|
|
Loading…
Reference in a new issue