From ad345ee1bf397e61a542fb0022e2f1c395a7bc2b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 19 May 2023 20:12:43 +0200 Subject: [PATCH] logbroker: properly catch KeyboardInterrupt to avoid a stracktrace when Ctrl+C --- moulinette/utils/log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moulinette/utils/log.py b/moulinette/utils/log.py index 07ee8bf0..2ac3d1d0 100644 --- a/moulinette/utils/log.py +++ b/moulinette/utils/log.py @@ -222,9 +222,11 @@ def start_log_broker(): frontend = ctx.socket(zmq.XPUB) frontend.bind(LOG_BROKER_FRONTEND_ENDPOINT) - zmq.proxy(frontend, backend) + try: + zmq.proxy(frontend, backend) + except KeyboardInterrupt: + pass - # Example says "we never get here"? frontend.close() backend.close() ctx.term()