This commit is contained in:
@ -2,3 +2,4 @@
|
||||
from .require_decorators import json_required
|
||||
from .error_handlers import register_all_error_handlers
|
||||
from .storage import storage
|
||||
from .healthchecks import health_database_status
|
23
storage_service/utils/healthchecks.py
Normal file
23
storage_service/utils/healthchecks.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from utils import storage
|
||||
|
||||
"""
|
||||
Healthchek functions
|
||||
"""
|
||||
|
||||
__author__ = "@tormakris"
|
||||
__copyright__ = "Copyright 2020, Birbnetes Team"
|
||||
__module_name__ = "healthchecks"
|
||||
__version__text__ = "1"
|
||||
|
||||
|
||||
def health_database_status():
|
||||
is_database_working = True
|
||||
output = 'storage is ok'
|
||||
try:
|
||||
storage.connection.list_buckets()
|
||||
except Exception as e:
|
||||
output = str(e)
|
||||
is_database_working = False
|
||||
return is_database_working, output
|
Reference in New Issue
Block a user