Added amqp to health check
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-07-26 15:24:17 +02:00
parent e64137ca56
commit 57b757cb41
3 changed files with 22 additions and 1 deletions

View File

@ -90,6 +90,13 @@ class MagicAMPQ:
if tries > 10:
time.sleep(2)
def is_healthy(self) -> bool:
with self._lock:
if not self._pika_channel:
return False
return self._pika_channel.is_open and self._pika_connection.is_open
# instance to be used in the flask app
magic_ampq = MagicAMPQ()