diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2024-09-14 14:48:53 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2024-09-14 14:48:53 -0700 |
commit | 257405af5bed5716c4e1e89ae0d163b5baf0a663 (patch) | |
tree | 98f29d478ce40959f778af4f241bf5aba09d9fe8 | |
parent | conf/rsync/g.mirrors.extra: drop swan.g.o (diff) | |
download | gentoo-mirrorstats-257405af5bed5716c4e1e89ae0d163b5baf0a663.tar.gz gentoo-mirrorstats-257405af5bed5716c4e1e89ae0d163b5baf0a663.tar.bz2 gentoo-mirrorstats-257405af5bed5716c4e1e89ae0d163b5baf0a663.zip |
fix: handle mirror_url fetch errors
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | html/generate.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/html/generate.py b/html/generate.py index a4b75e8..2d6ed2b 100755 --- a/html/generate.py +++ b/html/generate.py @@ -120,7 +120,13 @@ def getHostList(mirrorstatsList): # process all mirrors for mirror_url in mirrorstatsList: - mirrorData = getJson(mirror_url) + mirrorData = None + try: + mirrorData = getJson(mirror_url) + except Exception as err: + print("Exception fetching "+mirror_url+": ", err) + continue + lastUpdate = datetime.datetime.fromtimestamp(int(mirrorData['LastUpdate'])).strftime('%Y-%m-%d %H:%M:%S') for mirror in mirrorData['Mirrors']: |