зеркало из https://github.com/mozilla/treeherder.git
Bug 1394593 - Heroku: Use 'DYNO' to check if running on Heroku
On Heroku, the environment variable `DYNO` is always set in the environment. As such, we can just use that to determine whether code is being run on Heroku, rather than having to add our own environment variable.
This commit is contained in:
Родитель
d71ba1313e
Коммит
1fbf5dff99
|
@ -23,8 +23,6 @@ source $BIN_DIR/utils
|
|||
# Only variables that are rarely changed and not site-specific should
|
||||
# be set here. Set everything else using Heroku's CLI / dashboard.
|
||||
|
||||
set-env IS_HEROKU 1
|
||||
|
||||
# Override the hostname that is displayed in New Relic, so the Dyno name
|
||||
# (eg "web.1") is shown, rather than "Dynamic Hostname". $DYNO is quoted
|
||||
# so that it's expanded at runtime on each dyno, rather than now.
|
||||
|
|
|
@ -631,7 +631,7 @@ KEY_PREFIX = TREEHERDER_MEMCACHED_KEY_PREFIX
|
|||
# This code handles the memcachier service on heroku.
|
||||
# TODO: Stop special-casing Heroku and use newer best practices from:
|
||||
# https://www.memcachier.com/documentation#django.
|
||||
if env.bool('IS_HEROKU', default=False):
|
||||
if 'DYNO' in env:
|
||||
# Prefs taken from:
|
||||
# https://github.com/rdegges/django-heroku-memcacheify/blob/v1.0.0/memcacheify.py#L30-L39
|
||||
CACHES['default'].update({
|
||||
|
|
Загрузка…
Ссылка в новой задаче