Skip to content
Snippets Groups Projects
Commit b0b479cf authored by Gavin M. Roy's avatar Gavin M. Roy
Browse files

change the SimpleConnection exit logic to always close if needed

parent da4ba504
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,10 +38,12 @@ class SimpleChannel(object):
return self.channel
 
def __exit__(self, exc_type, exc_val, exc_tb):
if not self.channel.closed:
self.channel.close()
if not self.connection.closed:
self.connection.close()
if exc_type and exc_val:
raise
self.channel.close()
self.connection.close()
 
 
def consume(uri=None, queue_name=None, no_ack=False, prefetch=None,
Loading
Loading
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