Add 'gvapgsql/gvacommon/' from commit '546441d49920caf43eb7d33976c2d71ae85f16d5'
git-subtree-dir: gvapgsql/gvacommon git-subtree-mainline:e9c1a218d6
git-subtree-split:546441d499
This commit is contained in:
commit
8bf8ba0d66
3 changed files with 18 additions and 0 deletions
3
gvapgsql/gvacommon/.gitignore
vendored
Normal file
3
gvapgsql/gvacommon/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.*.swp
|
||||
*.pyc
|
||||
.ropeproject/
|
0
gvapgsql/gvacommon/__init__.py
Normal file
0
gvapgsql/gvacommon/__init__.py
Normal file
15
gvapgsql/gvacommon/celeryrouters.py
Normal file
15
gvapgsql/gvacommon/celeryrouters.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
# -*- 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
|
Loading…
Reference in a new issue