Skip to content
Snippets Groups Projects
Commit 21bf79c3 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add exception handle in start_consume method

parent 51f38b21
2 merge requests!23Feat resolve uid gid,!9Feat connection module
......@@ -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