This reverts commit 2ac0ba9827.
This commit is contained in:
Andrew Williamson 2017-03-22 11:01:39 +01:00 коммит произвёл GitHub
Родитель 2ac0ba9827
Коммит eb8887fba4
3 изменённых файлов: 4 добавлений и 36 удалений

Просмотреть файл

@ -47,6 +47,7 @@ SESSION_COOKIE_SECURE = False
SESSION_COOKIE_DOMAIN = None SESSION_COOKIE_DOMAIN = None
CELERY_ALWAYS_EAGER = False CELERY_ALWAYS_EAGER = False
CELERY_ROUTES = {}
# If you want to allow self-reviews for add-ons/apps, then enable this. # If you want to allow self-reviews for add-ons/apps, then enable this.
# In production we do not want to allow this. # In production we do not want to allow this.

Просмотреть файл

@ -10,8 +10,6 @@ from django.utils.functional import lazy
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
import environ import environ
from kombu import Queue
env = environ.Env() env = environ.Env()
@ -1059,27 +1057,6 @@ CELERY_IMPORTS = (
'olympia.lib.es.management.commands.reindex', 'olympia.lib.es.management.commands.reindex',
) )
CELERY_QUEUES = (
Queue('default', routing_key='default'),
Queue('priority', routing_key='priority'),
Queue('devhub', routing_key='devhub'),
Queue('images', routing_key='images'),
Queue('limited', routing_key='limited'),
Queue('amo', routing_key='amo'),
Queue('addons', routing_key='addons'),
Queue('api', routing_key='api'),
Queue('cron', routing_key='cron'),
Queue('bandwagon', routing_key='bandwagon'),
Queue('editors', routing_key='editors'),
Queue('crypto', routing_key='crypto'),
Queue('search', routing_key='search'),
Queue('reviews', routing_key='reviews'),
Queue('stats', routing_key='stats'),
Queue('tags', routing_key='tags'),
Queue('users', routing_key='users'),
Queue('zadmin', routing_key='zadmin'),
)
# We have separate celeryds for processing devhub & images as fast as possible # We have separate celeryds for processing devhub & images as fast as possible
# Some notes: # Some notes:
# - always add routes here instead of @task(queue=<name>) # - always add routes here instead of @task(queue=<name>)
@ -1144,6 +1121,9 @@ CELERY_ROUTES = {
'queue': 'addons'}, 'queue': 'addons'},
'olympia.addons.tasks.version_changed': {'queue': 'addons'}, 'olympia.addons.tasks.version_changed': {'queue': 'addons'},
# Files (goes to devhub queue).
'olympia.files.tasks.update_webext_descriptions_all': {'queue': 'devhub'},
# API # API
'olympia.api.tasks.process_results': {'queue': 'api'}, 'olympia.api.tasks.process_results': {'queue': 'api'},
'olympia.api.tasks.process_webhook': {'queue': 'api'}, 'olympia.api.tasks.process_webhook': {'queue': 'api'},

Просмотреть файл

@ -1,13 +0,0 @@
from django.conf import settings
def test_celery_routes_in_queues():
queues_in_queues = set([q.name for q in settings.CELERY_QUEUES])
# check the default queue is defined in CELERY_QUEUES
assert settings.CELERY_DEFAULT_QUEUE in queues_in_queues
# then remove it as it won't be in CELERY_ROUTES
queues_in_queues.remove(settings.CELERY_DEFAULT_QUEUE)
queues_in_routes = set(
[c['queue'] for c in settings.CELERY_ROUTES.values()])
assert queues_in_queues == queues_in_routes