gvafile/gvafile/gvacommon/celeryrouters.py
Jan Dittberner 26aae0173d Refactor fileservertasks into top level module
This change moves the fileservertasks module to the top level to allow
keeping the same task names when running in a Python 3 environment.
2020-03-04 16:53:50 +01:00

8 lines
309 B
Python

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