mirror of
https://github.com/django/django.git
synced 2025-04-15 04:44:37 +00:00
Pass alias and params separately to backend
This commit is contained in:
parent
a6153630ad
commit
c92a97267a
@ -38,7 +38,7 @@ class TasksHandler(BaseConnectionHandler):
|
||||
f"Could not find backend '{backend}': {e}"
|
||||
) from e
|
||||
|
||||
return backend_cls({**params, "ALIAS": alias})
|
||||
return backend_cls(alias=alias, params=params)
|
||||
|
||||
|
||||
tasks = TasksHandler()
|
||||
|
@ -24,10 +24,10 @@ class BaseTaskBackend(metaclass=ABCMeta):
|
||||
supports_get_result = False
|
||||
"""Can results be retrieved after the fact (from **any** thread / process)"""
|
||||
|
||||
def __init__(self, options):
|
||||
self.alias = options["ALIAS"]
|
||||
self.queues = set(options.get("QUEUES", [DEFAULT_QUEUE_NAME]))
|
||||
self.enqueue_on_commit = bool(options.get("ENQUEUE_ON_COMMIT", True))
|
||||
def __init__(self, alias, params):
|
||||
self.alias = alias
|
||||
self.queues = set(params.get("QUEUES", [DEFAULT_QUEUE_NAME]))
|
||||
self.enqueue_on_commit = bool(params.get("ENQUEUE_ON_COMMIT", True))
|
||||
|
||||
def _get_enqueue_on_commit_for_task(self, task):
|
||||
"""
|
||||
|
@ -16,8 +16,8 @@ class DummyBackend(BaseTaskBackend):
|
||||
supports_defer = True
|
||||
supports_async_task = True
|
||||
|
||||
def __init__(self, options) -> None:
|
||||
super().__init__(options)
|
||||
def __init__(self, alias, params) -> None:
|
||||
super().__init__(alias, params)
|
||||
|
||||
self.results = []
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user