input-service/src/healthchecks.py

23 lines
449 B
Python
Raw Permalink Normal View History

2020-11-19 00:30:26 +01:00
#!/usr/bin/env python3
from magic_amqp import magic_amqp
2020-11-19 00:30:26 +01:00
"""
Healthchek functions
"""
__author__ = "@tormakris"
__copyright__ = "Copyright 2020, Birbnetes Team"
__module_name__ = "healthchecks"
__version__text__ = "1"
def amqp_connection_status():
if magic_amqp.is_healthy():
2021-07-26 15:24:17 +02:00
result = True
text = "amqp connection is ok"
2021-07-26 15:24:17 +02:00
else:
result = False
text = "amqp connection is unhealthy"
2021-07-26 15:24:17 +02:00
return result, text