diff --git a/docker-compose.yml b/docker-compose.yml index f349edbe8e..18c236fc89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/settings.py b/settings.py index 461e46b171..0a4aca4d12 100644 --- a/settings.py +++ b/settings.py @@ -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 diff --git a/src/olympia/wsgi.py b/src/olympia/wsgi.py index 5ccd75e79b..b20f41c7bb 100644 --- a/src/olympia/wsgi.py +++ b/src/olympia/wsgi.py @@ -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'