Skip to content
Permalink
Browse files
Remove django-celery dependency
It is not Django 2.2 compatible, and it is not needed by celery
any more anyway.

mozilla/sumo#136
  • Loading branch information
benspaulding authored and akatsoulas committed May 29, 2020
1 parent 8035d87 commit 7a9979b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
@@ -1,3 +1,3 @@
#!/bin/bash

exec newrelic-admin run-program python manage.py celeryd --maxtasksperchild=${CELERY_MAX_TASKS_PER_CHILD:-25}
exec newrelic-admin run-program celery -A kitsune worker --maxtasksperchild=${CELERY_MAX_TASKS_PER_CHILD:-25}
@@ -41,7 +41,7 @@ Configuring and Running

We set some reasonable defaults for Celery in ``settings.py``. These can be
overriden either in ``settings_local.py`` or via the command line when running
``manage.py celeryd``.
``celery -A kitsune``.

In ``settings_local.py`` you should set at least this, if you want to use
Celery::
@@ -59,11 +59,11 @@ You can also configure the log level or concurrency. Here are the defaults::

Then to start the Celery workers, you just need to run::

./manage.py celeryd
celery -A kitsune

This will start Celery with the default number of worker threads and the
default logging level. You can change those with::

./manage.py celeryd --log-level=DEBUG -c 10
celery -A kitsune --log-level=DEBUG -c 10

This would start Celery with 10 worker threads and a log level of ``DEBUG``.
@@ -225,7 +225,7 @@ See ``--help`` for more details::
chunks by celery tasks. If you need to halt indexing, you can purge
the tasks with::

$ ./manage.py celeryctl purge
$ celery -A kitsune purge

If you do this often, it helps to write a shell script for it.

@@ -0,0 +1,3 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # noqa
@@ -0,0 +1,10 @@
import os

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')

from celery import Celery # noqa
from django.conf import settings # noqa

app = Celery('kitsune')
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(settings.INSTALLED_APPS)
@@ -9,7 +9,6 @@

import dj_database_url
import django_cache_url
import djcelery
from decouple import Csv, config

from kitsune.lib.sumo_locales import LOCALES
@@ -661,7 +660,6 @@ def _username_algo(email):
'kitsune.sumo',
'kitsune.search',
'kitsune.forums',
'djcelery',
'tidings',
'rest_framework.authtoken',
'kitsune.questions',
@@ -908,8 +906,6 @@ def JINJA_CONFIG():


# Celery
djcelery.setup_loader()

CELERY_IGNORE_RESULT = config('CELERY_IGNORE_RESULT', default=True, cast=bool)
if not CELERY_IGNORE_RESULT:
# E.g. redis://localhost:6479/1
@@ -6,7 +6,6 @@
# Now we can import from third-party libraries.

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')
os.environ.setdefault('CELERY_CONFIG_MODULE', 'kitsune.settings')

# MONKEYPATCH! WOO HOO!
# Need this so we patch before running Django-specific commands which
@@ -127,9 +127,6 @@ django-adminplus==0.5 \
--hash=sha256:e9497b409b28466e0f24119e3bc62d668a0eeec9229660ea3ae7d14dbc3c6353
https://github.com/django-security/django-axes/archive/778f208cc1d3cc42ecb756f732f8593e40ebb476.tar.gz#egg=django-axes==1.3.6 \
--hash=sha256:30ba613a0e8617555888185dd958407b6ec6255bbaf3718803e0e8771db5bd45
django-celery==3.2.2 \
--hash=sha256:1450264db5ec58e45f3f20d8d361e696920352f62481bf56047288cdb38bcc0b \
--hash=sha256:aaba492bf7777f231ec6b02c80aa3ea68758c39f4723864dd4164589b99ad703
django-cors-headers==2.4.0 \
--hash=sha256:5545009c9b233ea7e70da7dbab7cb1c12afa01279895086f98ec243d7eab46fa \
--hash=sha256:c4c2ee97139d18541a1be7d96fe337d1694623816d83f53cb7c00da9b94acae1
@@ -23,9 +23,6 @@
from decouple import config


# For django-celery
os.environ['CELERY_LOADER'] = 'django'

application = get_wsgi_application()

if config('ENABLE_WHITENOISE', default=False, cast=bool):

0 comments on commit 7a9979b

Please sign in to comment.