Allow tuning cache timeout
This allows users to tune cache timeout in Django. Change-Id: I18cf8d80074203c044e69609dd7f713f6a2a593d
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
# (optional) A hash of parameters to enable specific cache options.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*cache_timeout*]
|
||||
# (optional) The default timeout, in seconds, to use for the cache.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*cache_server_url*]
|
||||
# (optional) URL of a cache server.
|
||||
# This allows arbitrary strings to be set as CACHE BACKEND LOCATION.
|
||||
@@ -567,6 +571,7 @@ class horizon(
|
||||
$package_ensure = 'present',
|
||||
$cache_backend = 'django.core.cache.backends.locmem.LocMemCache',
|
||||
$cache_options = undef,
|
||||
$cache_timeout = undef,
|
||||
$cache_server_url = undef,
|
||||
$cache_server_ip = undef,
|
||||
$cache_server_port = '11211',
|
||||
|
4
releasenotes/notes/cache_timeout-40252b507b11e4e5.yaml
Normal file
4
releasenotes/notes/cache_timeout-40252b507b11e4e5.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``horizon::cache_timeout`` parameter has been added.
|
@@ -99,6 +99,7 @@ describe 'horizon' do
|
||||
before do
|
||||
params.merge!({
|
||||
:cache_backend => 'django.core.cache.backends.memcached.MemcachedCache',
|
||||
:cache_timeout => 300,
|
||||
:cache_options => {'SOCKET_TIMEOUT' => 1,'SERVER_RETRIES' => 1,'DEAD_RETRY' => 1},
|
||||
:cache_server_ip => '10.0.0.1',
|
||||
:django_session_engine => 'django.contrib.sessions.backends.cache',
|
||||
@@ -166,6 +167,7 @@ describe 'horizon' do
|
||||
" 'SOCKET_TIMEOUT': 1,",
|
||||
" 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',",
|
||||
" 'LOCATION': '10.0.0.1:11211',",
|
||||
" 'TIMEOUT': 300,",
|
||||
'SESSION_ENGINE = "django.contrib.sessions.backends.cache"',
|
||||
'OPENSTACK_KEYSTONE_URL = "https://keystone.example.com:4682"',
|
||||
'OPENSTACK_KEYSTONE_DEFAULT_ROLE = "SwiftOperator"',
|
||||
|
@@ -240,6 +240,9 @@ CACHES = {
|
||||
'LOCATION': '<%= @cache_server_url %>',
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- if @cache_timeout -%>
|
||||
'TIMEOUT': <%= @cache_timeout %>,
|
||||
<%- end -%>
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user