mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Fix for KeyError when cache is empty, change cache key prefix for dev vs. prod.
Conflicts: awx/settings/production.py
This commit is contained in:
committed by
Matthew Jones
parent
a4f5b0ae71
commit
db3151a9dd
@@ -300,7 +300,7 @@ class Host(CommonModelNameNotUnique):
|
|||||||
if summary_data[key] is None:
|
if summary_data[key] is None:
|
||||||
rebuild_cache = True
|
rebuild_cache = True
|
||||||
break
|
break
|
||||||
if rebuild_cache:
|
if rebuild_cache or not summary_data:
|
||||||
summary_data = self.update_cached_values()
|
summary_data = self.update_cached_values()
|
||||||
summary_data_actual = dict(all_groups=summary_data['%s_all_groups' % self.id],
|
summary_data_actual = dict(all_groups=summary_data['%s_all_groups' % self.id],
|
||||||
groups=summary_data['%s_groups' % self.id],
|
groups=summary_data['%s_groups' % self.id],
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ CACHES = {
|
|||||||
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
||||||
'LOCATION': '127.0.0.1:11211',
|
'LOCATION': '127.0.0.1:11211',
|
||||||
'TIMEOUT': 864000,
|
'TIMEOUT': 864000,
|
||||||
|
'KEY_PREFIX': 'tower_dev',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ JOBOUTPUT_ROOT = '/var/lib/awx/job_status/'
|
|||||||
# The heartbeat file for the tower scheduler
|
# The heartbeat file for the tower scheduler
|
||||||
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'
|
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'
|
||||||
|
|
||||||
|
# Use different cache prefix for production vs. development.
|
||||||
|
CACHES['default']['KEY_PREFIX'] = 'tower'
|
||||||
|
|
||||||
LOGGING['handlers']['rotating_file'] = {
|
LOGGING['handlers']['rotating_file'] = {
|
||||||
'level': 'WARNING',
|
'level': 'WARNING',
|
||||||
'class':'logging.handlers.RotatingFileHandler',
|
'class':'logging.handlers.RotatingFileHandler',
|
||||||
|
|||||||
Reference in New Issue
Block a user