Fix issue with stacktrace on CTRL+C

This commit is contained in:
Shane Lee 2024-02-08 08:51:18 -07:00 committed by Pedro Algarvio
parent aee4cbc53c
commit 2b028dc565

View file

@ -703,7 +703,7 @@ class PublishServer(salt.transport.base.DaemonizedPublishServer):
):
"""
This method represents the Publish Daemon process. It is intended to be
run in a thread or process as it creates and runs an it's own ioloop.
run in a thread or process as it creates and runs its own ioloop.
"""
ioloop = salt.ext.tornado.ioloop.IOLoop()
ioloop.make_current()
@ -750,6 +750,8 @@ class PublishServer(salt.transport.base.DaemonizedPublishServer):
pull_sock.on_recv(on_recv)
try:
ioloop.start()
except KeyboardInterrupt:
pass
finally:
pub_sock.close()
pull_sock.close()