summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2014-01-14 17:24:24 +0100
committerAlex Legler <alex@a3li.li>2014-01-14 17:24:24 +0100
commit0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd (patch)
treecfea2bb812c12257eee5199cd0a5dd65c3eef8dd /lib
parentFix recursion in update logic (diff)
downloadinfra-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.rb4
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