summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2014-01-11 12:20:46 +0100
committerAlex Legler <alex@a3li.li>2014-01-11 12:30:13 +0100
commit95485ba4f911cdcccaad3b5f4080ac704dce94e4 (patch)
tree7df8e239846bf6cce8db34dbedfe07e634662246
parentProperly clear the ServiceRegistry cache (diff)
downloadinfra-status-95485ba4f911cdcccaad3b5f4080ac704dce94e4.tar.gz
infra-status-95485ba4f911cdcccaad3b5f4080ac704dce94e4.tar.bz2
infra-status-95485ba4f911cdcccaad3b5f4080ac704dce94e4.zip
Properly clear the ServiceRegistry cache
-rw-r--r--infra-status.rb1
-rw-r--r--lib/service_registry.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/infra-status.rb b/infra-status.rb
index b3bec91..5072af5 100644
--- a/infra-status.rb
+++ b/infra-status.rb
@@ -19,6 +19,7 @@ configure do
ServiceRegistry.instance.update!
set :partial_template_engine, :erb
mime_type :atom, 'application/atom+xml'
+ set :bind, '0.0.0.0'
end
get '/' do
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index b1640ff..3521fce 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -98,7 +98,7 @@ class ServiceRegistry
private
def update?
- if ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
+ if not @load_date.nil? and ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
update!
end
end