Commit 11572b13 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add checks for the rabbitmq connection and channel

parent 9d568e9e
......@@ -69,7 +69,11 @@ class RabbitMQInstance(models.Model):
def connection(self):
if self.rabbitmq_connection is None:
if (
self.rabbitmq_connection is None
or self.rabbitmq_connection.is_closed
or self.rabbitmq_connection.is_closing
rabbitmqconnection_properties = pika.ConnectionParameters(,
......@@ -83,7 +87,11 @@ class RabbitMQInstance(models.Model):
def channel(self):
if self.rabbitmq_channel is None:
if (
self.rabbitmq_channel is None
or self.rabbitmq_channel.is_closed
or self.rabbitmq_channel.is_closing
self.rabbitmq_channel =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment