Bug 1291307 - Stop using django-heroku-memcacheify

Since it clobbers the settings we need to use on Heroku for making
memcached connections via stunnel. In addition, it made the cache
configuration very opaque, and doesn't use the latest best practices
suggested on:
https://www.memcachier.com/documentation#django
This commit is contained in:
Ed Morley 2016-08-31 16:24:52 +01:00
Родитель c7ea6c9979
Коммит 8701b64f57
2 изменённых файлов: 15 добавлений и 6 удалений

Просмотреть файл

@ -1,5 +1,3 @@
# HEROKU REQUIREMENTS
-r requirements/common.txt
django-heroku-memcacheify==1.0.0 --hash=sha256:971c63f9af5bee2884bbfd308457b6675b35b89a33cf42c1c4f0a554c324a563

Просмотреть файл

@ -546,6 +546,8 @@ if env.bool('IS_HEROKU', default=False):
}
# TREEHERDER_MEMCACHED is a string of comma-separated address:port pairs
# NB: On Heroku this will be set to localhost, so that the connection
# occurs via the stunnel established by memcachier-tls-buildpack.
MEMCACHED_LOCATION = TREEHERDER_MEMCACHED.strip(',').split(',')
CACHES = {
@ -580,11 +582,20 @@ if server_supports_tls(BROKER_URL):
BROKER_USE_SSL = True
# This code handles the memcachier service on heroku.
# TODO: Once no longer on SCL3, stop special-casing Heroku and use newer
# best practices from https://www.memcachier.com/documentation#django.
if env.bool('IS_HEROKU', default=False):
from memcacheify import memcacheify
CACHES['default'].update(
memcacheify().get('default')
)
# Prefs taken from:
# https://github.com/rdegges/django-heroku-memcacheify/blob/v1.0.0/memcacheify.py#L30-L39
CACHES['default'].update({
"BINARY": True,
"USERNAME": env('MEMCACHIER_USERNAME', default=None),
"PASSWORD": env('MEMCACHIER_PASSWORD', default=None),
"OPTIONS": {
"ketama": True,
"tcp_nodelay": True,
},
})
CELERY_IGNORE_RESULT = True