Fix queue typos. Add a default queue as required by celery.
This commit is contained in:
@@ -2,6 +2,8 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
from kombu import Exchange, Queue
|
||||
|
||||
from django.db.models.signals import pre_save
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
@@ -22,6 +24,8 @@ from .permissions import (
|
||||
permission_document_checkin, permission_document_checkin_override,
|
||||
permission_document_checkout
|
||||
)
|
||||
from .tasks import task_check_expired_check_outs # NOQA
|
||||
# Required so that celerybeat can find the task
|
||||
|
||||
|
||||
class CheckoutsApp(MayanAppConfig):
|
||||
@@ -46,13 +50,26 @@ class CheckoutsApp(MayanAppConfig):
|
||||
)
|
||||
)
|
||||
|
||||
app.conf.CELERYBEAT_SCHEDULE.update({
|
||||
'check_expired_check_outs': {
|
||||
'task': 'checkouts.tasks.task_check_expired_check_outs',
|
||||
'schedule': timedelta(seconds=CHECK_EXPIRED_CHECK_OUTS_INTERVAL),
|
||||
'options': {'queue': 'checkouts'}
|
||||
},
|
||||
})
|
||||
app.conf.CELERYBEAT_SCHEDULE.update(
|
||||
{
|
||||
'task_check_expired_check_outs': {
|
||||
'task': 'checkouts.tasks.task_check_expired_check_outs',
|
||||
'schedule': timedelta(seconds=CHECK_EXPIRED_CHECK_OUTS_INTERVAL),
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
app.conf.CELERY_QUEUES.append(
|
||||
Queue('checkouts_periodic', Exchange('checkouts_periodic'), routing_key='checkouts_periodic', delivery_mode=1),
|
||||
)
|
||||
|
||||
app.conf.CELERY_ROUTES.update(
|
||||
{
|
||||
'checkouts.tasks.task_check_expired_check_outs': {
|
||||
'queue': 'checkouts_periodic'
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
menu_facet.bind_links(links=[link_checkout_info], sources=[Document])
|
||||
menu_main.bind_links(links=[link_checkout_list])
|
||||
|
||||
@@ -51,10 +51,15 @@ class CommonApp(MayanAppConfig):
|
||||
def ready(self):
|
||||
super(CommonApp, self).ready()
|
||||
|
||||
app.conf.CELERY_QUEUES.append(
|
||||
Queue('tools', Exchange('tools'), routing_key='tools'),
|
||||
app.conf.CELERY_QUEUES.extend(
|
||||
(
|
||||
Queue('default', Exchange('default'), routing_key='default'),
|
||||
Queue('tools', Exchange('tools'), routing_key='tools'),
|
||||
)
|
||||
)
|
||||
|
||||
app.conf.CELERY_DEFAULT_QUEUE = 'default'
|
||||
|
||||
menu_facet.bind_links(links=[link_current_user_details, link_current_user_locale_profile_details, link_tools, link_setup], sources=['common:current_user_details', 'common:current_user_edit', 'common:current_user_locale_profile_details', 'common:current_user_locale_profile_edit', 'authentication:password_change_view', 'common:setup_list', 'common:tools_list'])
|
||||
menu_main.bind_links(links=[link_about], position=-1)
|
||||
menu_secondary.bind_links(
|
||||
|
||||
@@ -137,10 +137,10 @@ class DocumentsApp(MayanAppConfig):
|
||||
app.conf.CELERY_ROUTES.update(
|
||||
{
|
||||
'documents.tasks.task_check_delete_periods': {
|
||||
'queue': 'documents'
|
||||
'queue': 'documents_periodic'
|
||||
},
|
||||
'documents.tasks.task_check_trash_periods': {
|
||||
'queue': 'documents'
|
||||
'queue': 'documents_periodic'
|
||||
},
|
||||
'documents.tasks.task_clear_image_cache': {
|
||||
'queue': 'tools'
|
||||
|
||||
@@ -267,6 +267,7 @@ CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
|
||||
TEST_RUNNER = 'djcelery.contrib.test_runner.CeleryTestSuiteRunner'
|
||||
CELERY_QUEUES = []
|
||||
CELERY_ROUTES = {}
|
||||
CELERY_CREATE_MISSING_QUEUES = False
|
||||
# ------------ CORS ------------
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
# ------ Django REST Swagger -----
|
||||
|
||||
Reference in New Issue
Block a user