From a5c17a87196b6741742170a9395e80d3e508b8de Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 25 May 2016 13:49:46 -0400 Subject: [PATCH] Add option to make cache expiration configurable This commit adds a cache_expiration parameter to make the cache expiration for the api configurable. By default it sets it 15min (which is half of the far more conservative openstack-health default) to match the longest e-r query times seen in testing. Change-Id: Iaea17e16f6995121ad54bae2c46a96112b702caf --- manifests/api.pp | 1 + templates/openstack-health.conf.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/manifests/api.pp b/manifests/api.pp index 6ea09e8..65e77a1 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -18,6 +18,7 @@ class openstack_health::api( $elastic_recheck_dir = '/opt/elastic-recheck', $elastic_recheck_repo = 'https://git.openstack.org/openstack-infra/elastic-recheck', $elastic_recheck_revision = 'master', + $cache_expiration = 900, ) { include ::httpd::mod::wsgi diff --git a/templates/openstack-health.conf.erb b/templates/openstack-health.conf.erb index 12aec86..c54c0c1 100644 --- a/templates/openstack-health.conf.erb +++ b/templates/openstack-health.conf.erb @@ -1,5 +1,6 @@ [default] query_dir = <%= @elastic_recheck_dir %>/queries +cache_expiration = <%= @cache_expiration %> db_uri = <%= scope.lookupvar("openstack_health::api::db_uri") %> <% if @ignored_keys.length > 0 -%> ignored_run_metadata_keys =