parent
abce6a8dbc
commit
c30b8dd1ad
3 changed files with 19 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
import logging
|
||||
from data.model import health
|
||||
from app import build_logs
|
||||
from app import build_logs, storage
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -32,11 +32,20 @@ def _check_redis(app):
|
|||
""" Returns the status of Redis, as accessed from this instance. """
|
||||
return build_logs.check_health()
|
||||
|
||||
def _check_storage(app):
|
||||
""" Returns the status of storage, as accessed from this instance. """
|
||||
try:
|
||||
storage.validate(storage.preferred_locations, app.config['HTTPCLIENT'])
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
_SERVICES = {
|
||||
'registry_gunicorn': _check_registry_gunicorn,
|
||||
'database': _check_database,
|
||||
'redis': _check_redis
|
||||
'redis': _check_redis,
|
||||
'storage': _check_storage,
|
||||
}
|
||||
|
||||
def check_all_services(app, skip):
|
||||
|
|
Reference in a new issue