Merge "Delete fanout queues on gracefully shutdown"
This commit is contained in:
commit
2f810679f1
|
@ -844,6 +844,11 @@ class Connection(object):
|
||||||
"""Close/release this connection."""
|
"""Close/release this connection."""
|
||||||
self._heartbeat_stop()
|
self._heartbeat_stop()
|
||||||
if self.connection:
|
if self.connection:
|
||||||
|
for consumer, tag in self._consumers.items():
|
||||||
|
if consumer.type == 'fanout':
|
||||||
|
LOG.debug('[connection close] Deleting fanout '
|
||||||
|
'queue: %s ' % consumer.queue.name)
|
||||||
|
consumer.queue.delete()
|
||||||
self._set_current_channel(None)
|
self._set_current_channel(None)
|
||||||
self.connection.release()
|
self.connection.release()
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
@ -852,7 +857,6 @@ class Connection(object):
|
||||||
"""Reset a connection so it can be used again."""
|
"""Reset a connection so it can be used again."""
|
||||||
recoverable_errors = (self.connection.recoverable_channel_errors +
|
recoverable_errors = (self.connection.recoverable_channel_errors +
|
||||||
self.connection.recoverable_connection_errors)
|
self.connection.recoverable_connection_errors)
|
||||||
|
|
||||||
with self._connection_lock:
|
with self._connection_lock:
|
||||||
try:
|
try:
|
||||||
for consumer, tag in self._consumers.items():
|
for consumer, tag in self._consumers.items():
|
||||||
|
|
Loading…
Reference in New Issue