diff options
author | Alex Legler <alex@a3li.li> | 2014-01-14 17:24:24 +0100 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2014-01-14 17:24:24 +0100 |
commit | 0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd (patch) | |
tree | cfea2bb812c12257eee5199cd0a5dd65c3eef8dd /lib | |
parent | Fix recursion in update logic (diff) | |
download | infra-status-0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd.tar.gz infra-status-0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd.tar.bz2 infra-status-0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd.zip |
Rescue JSON parse failures
In case of an error, set a date in the past to retry next request.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/service_registry.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/service_registry.rb b/lib/service_registry.rb index f21a74a..19734e3 100644 --- a/lib/service_registry.rb +++ b/lib/service_registry.rb @@ -98,6 +98,10 @@ class ServiceRegistry load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb')) @load_date = DateTime.now @cache_locked = false + rescue Exception + @services = {} + @load_date = DateTime.new(2000, 1, 1) + @cache_locked = false end private |