gvapgsql/gvapgsql/gvacommon/celeryrouters.py
Jan Dittberner 68f0834954 Refactor module structure
Move pgsqltasks to top level to keep the task names when using Python 3
2020-03-04 18:14:08 +01:00

11 lines
344 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