projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4482360
)
Add a tiny bit of error handling for health checking
author
Tollef Fog Heen
<tfheen@err.no>
Sat, 30 Sep 2017 20:59:20 +0000
(22:59 +0200)
committer
Tollef Fog Heen
<tfheen@err.no>
Sat, 30 Sep 2017 20:59:20 +0000
(22:59 +0200)
modules/roles/files/mirror_health/mirror-health
patch
|
blob
|
history
diff --git
a/modules/roles/files/mirror_health/mirror-health
b/modules/roles/files/mirror_health/mirror-health
index
6214882
..
ed87f56
100755
(executable)
--- a/
modules/roles/files/mirror_health/mirror-health
+++ b/
modules/roles/files/mirror_health/mirror-health
@@
-32,10
+32,13
@@
def last_modified(response):
while True:
start = time.time()
for host in HOSTS:
while True:
start = time.time()
for host in HOSTS:
- lm = last_modified(retrieve_from_host(host, URL))
- logging.debug("lm for host %s: %s", host, lm)
- if lm > latest_ts:
- latest_ts = lm
+ try:
+ lm = last_modified(retrieve_from_host(host, URL))
+ logging.debug("lm for host %s: %s", host, lm)
+ if lm > latest_ts:
+ latest_ts = lm
+ except requests.exceptions.ProxyError:
+ pass
local_lm = last_modified(retrieve_from_host('localhost', URL))
logging.debug("lm for localhost: %s", local_lm)
if local_lm < latest_ts:
local_lm = last_modified(retrieve_from_host('localhost', URL))
logging.debug("lm for localhost: %s", local_lm)
if local_lm < latest_ts: