Skip to content
Snippets Groups Projects
Commit 9cbacf37 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Hide traceback after Ctrl-C

parent 2aec88d4
No related branches found
No related tags found
1 merge request!452Send Kafka notifications when correction is complete
...@@ -19,6 +19,10 @@ print(f"brokers: {brokers!r}") ...@@ -19,6 +19,10 @@ print(f"brokers: {brokers!r}")
kc = KafkaConsumer(topic, bootstrap_servers=brokers) kc = KafkaConsumer(topic, bootstrap_servers=brokers)
print("Waiting for messages (Ctrl-C to quit)...") print("Waiting for messages (Ctrl-C to quit)...")
for record in kc: try:
msg = json.loads(record.value.decode()) for record in kc:
print(msg) msg = json.loads(record.value.decode())
print(msg)
except KeyboardInterrupt:
print("Exiting")
kc.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment