use celery routers from gvacommon
This commit is contained in:
parent
17ca226dc0
commit
505b9c934b
3 changed files with 3 additions and 22 deletions
|
@ -1,6 +1,7 @@
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
* :support:`-` use celery routers from gvacommon
|
||||||
* :feature:`-` automatic creation of mailbox names from user names
|
* :feature:`-` automatic creation of mailbox names from user names
|
||||||
* :bug:`-` fix broken mailbox admin
|
* :bug:`-` fix broken mailbox admin
|
||||||
|
|
||||||
|
|
|
@ -279,8 +279,8 @@ CELERY_RESULT_BACKEND = 'amqp'
|
||||||
CELERY_RESULT_PERSISTENT = True
|
CELERY_RESULT_PERSISTENT = True
|
||||||
CELERY_TASK_RESULT_EXPIRES = None
|
CELERY_TASK_RESULT_EXPIRES = None
|
||||||
CELERY_ROUTES = (
|
CELERY_ROUTES = (
|
||||||
'osusers.tasks.LdapRouter',
|
'gvacommon.celeryrouters.LdapRouter',
|
||||||
'osusers.tasks.FileRouter',
|
'gvacommon.celeryrouters.FileRouter',
|
||||||
)
|
)
|
||||||
CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json']
|
CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json']
|
||||||
CELERY_TASK_SERIALIZER = 'json'
|
CELERY_TASK_SERIALIZER = 'json'
|
||||||
|
|
|
@ -3,26 +3,6 @@ from __future__ import absolute_import
|
||||||
from celery import shared_task
|
from celery import shared_task
|
||||||
|
|
||||||
|
|
||||||
class LdapRouter(object):
|
|
||||||
|
|
||||||
def route_for_task(self, task, args=None, kwargs=None):
|
|
||||||
if 'ldap' in task:
|
|
||||||
return {'exchange': 'ldap',
|
|
||||||
'exchange_type': 'direct',
|
|
||||||
'queue': 'ldap'}
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class FileRouter(object):
|
|
||||||
|
|
||||||
def route_for_task(self, task, args=None, kwargs=None):
|
|
||||||
if 'file' in task:
|
|
||||||
return {'exchange': 'file',
|
|
||||||
'exchange_type': 'direct',
|
|
||||||
'queue': 'file'}
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def create_ldap_group(groupname, gid, descr):
|
def create_ldap_group(groupname, gid, descr):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue