gvapgsql/celeryrouters.py
Jan Dittberner 546441d499 unify routers, add support for mysql and pgsql tasks
- add new celeryrouters.GvaRouter
- remove LdapRouter and FileRouter
2015-01-01 22:32:37 +01:00

15 lines
424 B
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
class GvaRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
for route in ['ldap', 'file', 'mysql', 'pgsql']:
if route in task:
return {
'exchange': route,
'exchange_type': 'direct',
'queue': route,
}
return None