fix: python container healthcheck

ping all backing services
This commit is contained in:
Revant Nandgaonkar
2020-03-14 22:47:35 +05:30
parent 817ab58c2d
commit 40ceb79023
2 changed files with 109 additions and 35 deletions

View File

@@ -1,4 +1,26 @@
import frappe
from frappe.utils.doctor import doctor
import json
import redis
from rq import Worker
from check_connection import (
check_mariadb,
check_redis_cache,
check_redis_queue,
check_redis_socketio,
)
doctor()
def main():
check_mariadb(retry=1, delay=0, print_attempt=False)
print("MariaDB Connected")
check_redis_cache(retry=1, delay=0, print_attempt=False)
print("Redis Cache Connected")
check_redis_queue(retry=1, delay=0, print_attempt=False)
print("Redis Queue Connected")
check_redis_socketio(retry=1, delay=0, print_attempt=False)
print("Redis SocketIO Connected")
print("Health check successful")
exit(0)
if __name__ == "__main__":
main()