greenwave: Use pymemcache as cache backend
Uses the dogpile cache backend that is now installed in the new greenwave container images. This replaces the old python-memcached backend which has not been updated in many years and we has some compatibility issues (https://github.com/linsomniac/python-memcached/issues/176).
This commit is contained in:
parent
40633757bf
commit
42b91b718b
1 changed files with 11 additions and 2 deletions
|
@ -30,11 +30,20 @@ CORS_URL = 'https://bodhi.fedoraproject.org'
|
||||||
MESSAGING = "fedora-messaging"
|
MESSAGING = "fedora-messaging"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
# TODO: This is for backwards compatibility. Remove in the near future.
|
||||||
|
import importlib # noqa: E402
|
||||||
|
if importlib.util.find_spec("pymemcache") is None:
|
||||||
|
greenwave_cache_backend = "dogpile.cache.memcached"
|
||||||
|
else:
|
||||||
|
greenwave_cache_backend = "dogpile.cache.pymemcache"
|
||||||
|
|
||||||
CACHE = {
|
CACHE = {
|
||||||
'backend': 'dogpile.cache.memcached',
|
'backend': greenwave_cache_backend,
|
||||||
'expiration_time': 3600, # 3600 is 1 hour
|
'expiration_time': 3600, # 3600 is 1 hour
|
||||||
'arguments': {
|
'arguments': {
|
||||||
'url': 'greenwave-memcached:11211',
|
'url': 'greenwave-memcached:11211',
|
||||||
'distributed_lock': True
|
'distributed_lock': True,
|
||||||
|
# Release lock in case the owner was terminated.
|
||||||
|
'lock_timeout': 120,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue