Add a timeout to the health check on the registry workers

This commit is contained in:
Joseph Schorr 2015-01-16 13:22:54 -05:00
parent 93708d0131
commit 2bae008bb1

View file

@ -167,7 +167,7 @@ def health():
port = ':' + hostname_parts[1]
registry_url = '%s://localhost%s/v1/_internal_ping' % (app.config['PREFERRED_URL_SCHEME'], port)
registry_healthy = client.get(registry_url, verify=False).status_code == 200
registry_healthy = client.get(registry_url, verify=False, timeout=2).status_code == 200
check = HealthCheck.get_check(app.config['HEALTH_CHECKER'][0], app.config['HEALTH_CHECKER'][1])
(data, is_healthy) = check.conduct_healthcheck(db_healthy, buildlogs_healthy, registry_healthy)