I hate Redis!

- Remove redis check from our health endpoint in prod entirely
- Have the redis check have a maximum timeout of 1 second
This commit is contained in:
Joseph Schorr 2015-10-22 13:24:56 -04:00
parent ad53bf5671
commit c518874ded
3 changed files with 22 additions and 10 deletions

View file

@ -10,16 +10,17 @@ def get_healthchecker(app, config_provider):
class HealthCheck(object):
def __init__(self, app, config_provider):
def __init__(self, app, config_provider, instance_skips=None):
self.app = app
self.config_provider = config_provider
self.instance_skips = instance_skips or []
def check_instance(self):
"""
Conducts a check on this specific instance, returning a dict representing the HealthCheck
output and a number indicating the health check response code.
"""
service_statuses = check_all_services(self.app)
service_statuses = check_all_services(self.app, skip=self.instance_skips)
return self.get_instance_health(service_statuses)
def check_endtoend(self):
@ -80,7 +81,7 @@ class LocalHealthCheck(HealthCheck):
class ProductionHealthCheck(HealthCheck):
def __init__(self, app, config_provider, access_key, secret_key, db_instance='quay'):
super(ProductionHealthCheck, self).__init__(app, config_provider)
super(ProductionHealthCheck, self).__init__(app, config_provider, ['redis'])
self.access_key = access_key
self.secret_key = secret_key
self.db_instance = db_instance
@ -92,7 +93,7 @@ class ProductionHealthCheck(HealthCheck):
def get_instance_health(self, service_statuses):
# Note: We skip the redis check because if redis is down, we don't want ELB taking the
# machines out of service. Redis is not considered a high avaliability-required service.
skip = ['redis']
skip = []
notes = []
# If the database is marked as unhealthy, check the status of RDS directly. If RDS is