Skip to content
Snippets Groups Projects
Commit 2d30f2b5 authored by Bo-Chun Chen's avatar Bo-Chun Chen Committed by Ravi Tripathi
Browse files

Add exception handle in start_consume method

parent 346992a7
No related branches found
No related tags found
1 merge request!27Feat rc_util add function
......@@ -76,7 +76,10 @@ class RCRMQ(object):
self.connect()
self._consumer_tag = self._channel.basic_consume(self.QUEUE,obj['cb'])
self._channel.start_consuming()
try:
self._channel.start_consuming()
except KeyboardInterrupt:
self._channel.stop_consuming()
self.disconnect()
......
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