Allow setting the recursion limit with RECURSION_LIMIT (fixes #1911)
This commit is contained in:
Родитель
a888361aa1
Коммит
0d1edc19f2
|
@ -20,6 +20,7 @@ worker: &worker
|
|||
- OLYMPIA_SITE_URL
|
||||
- PYTHONDONTWRITEBYTECODE=1
|
||||
- PYTHONUNBUFFERED=1
|
||||
- RECURSION_LIMIT=10000
|
||||
- REDIS_LOCATION=redis://redis:6379/0?socket_timeout=0.5
|
||||
- TERM=xterm-256color
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ import os
|
|||
|
||||
from olympia.lib.settings_base import * # noqa
|
||||
|
||||
WSGI_APPLICATION = 'olympia.wsgi.application'
|
||||
|
||||
DEBUG = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
DEBUG_PROPAGATE_EXCEPTIONS = False
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import logging
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
log = logging.getLogger('z.startup')
|
||||
|
@ -7,6 +8,16 @@ log = logging.getLogger('z.startup')
|
|||
# Remember when mod_wsgi loaded this file so we can track it in nagios.
|
||||
wsgi_loaded = datetime.now()
|
||||
|
||||
if 'RECURSION_LIMIT' in os.environ:
|
||||
try:
|
||||
limit = int(os.environ['RECURSION_LIMIT'])
|
||||
except TypeError:
|
||||
log.warning('Unable to parse RECURSION_LIMIT "{}"'.format(
|
||||
os.environ['RECURSION_LIMIT']))
|
||||
else:
|
||||
sys.setrecursionlimit(limit)
|
||||
log.info('Set RECURSION_LIMIT to {}'.format(limit))
|
||||
|
||||
# Tell celery that we're using Django.
|
||||
os.environ['CELERY_LOADER'] = 'django'
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче