Commit 534f706f authored by sim's avatar sim

Use recommended setup for Celery

Note: does it improve anything?
parent 92431aa8
from .celery import app as celery_app
"""
Setup the Celery instance (see also gargantext/__init__.py) that will be
used by all shared_task.
This is the recommended way:
http://docs.celeryproject.org/en/3.1/django/first-steps-with-django.html
"""
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gargantext.settings')
from django.conf import settings #noqa
app = Celery('gargantext')
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
......@@ -34,9 +34,12 @@ ALLOWED_HOSTS = ["localhost", ".gargantext.org", ".iscpif.fr",]
import djcelery
djcelery.setup_loader()
BROKER_URL = 'amqp://guest:guest@localhost:5672/'
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
CELERY_TIMEZONE = 'Europe/Paris'
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
CELERY_IMPORTS = (
"gargantext.util.toolchain",
"gargantext.util.crawlers",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment