Make the DB health check first attempt a simple DB connection. If the database is in the middle of a failover, this will fail after 3 seconds (the connection timeout specified), rather than hanging and causing the ELB health checks to timeout and fail.

This commit is contained in:
Joseph Schorr 2015-01-20 14:46:22 -05:00
parent 2a89accc49
commit 92d32bc636
3 changed files with 27 additions and 6 deletions

View file

@ -161,7 +161,7 @@ def v1():
def health():
client = app.config['HTTPCLIENT']
db_healthy = model.check_health()
db_healthy = model.check_health(app.config)
buildlogs_healthy = build_logs.check_health()
hostname_parts = app.config['SERVER_HOSTNAME'].split(':')
@ -187,7 +187,7 @@ def health():
@web.route('/status', methods=['GET'])
@no_cache
def status():
db_healthy = model.check_health()
db_healthy = model.check_health(app.config)
buildlogs_healthy = build_logs.check_health()
response = jsonify({