gvapgsql/gvapgsql/gvacommon/celeryrouters.py

11 lines
344 B
Python
Raw Normal View History

2014-12-27 13:52:45 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
class GvaRouter(object):
2014-12-27 13:52:45 +01:00
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}
2014-12-27 13:52:45 +01:00
return None