- lm = last_modified(retrieve_from_host(host, URL))
- logging.debug("lm for host %s: %s", host, lm)
- if lm > latest_ts:
- latest_ts = lm
- local_lm = last_modified(retrieve_from_host('localhost', URL))
+ try:
+ lm = last_modified(retrieve_from_host(host, URL))
+ logging.debug("lm for host %s: %s", host, lm)
+ if healthy(retrieve_from_host(host, HEALTH_CHECK_URL)):
+ latest_ts = max(latest_ts, lm)
+ except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
+ pass
+ try:
+ local_lm = last_modified(retrieve_from_host('localhost', URL))
+ except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout, requests.exceptions.ConnectTimeout, requests.exceptions.ConnectionError):
+ return False