mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 20:08:12 +08:00
Merge branch 'master' into refactor
This commit is contained in:
+5
-2
@@ -32,6 +32,7 @@ def async_task(func, *args, **kwargs):
|
||||
"iter_cached",
|
||||
"chain",
|
||||
"broker",
|
||||
"cluster",
|
||||
"timeout",
|
||||
)
|
||||
q_options = given_kwargs.pop("q_options", {})
|
||||
@@ -46,7 +47,7 @@ def async_task(func, *args, **kwargs):
|
||||
)
|
||||
|
||||
# don't serialize the broker
|
||||
broker = given_kwargs.pop("broker", None) or q_options.pop("broker", None) or get_broker()
|
||||
broker = given_kwargs.pop("broker", None) or q_options.pop("broker", None) or get_broker(task.get("cluster")) or get_broker()
|
||||
|
||||
print(broker.list_key)
|
||||
|
||||
@@ -65,7 +66,7 @@ def async_task(func, *args, **kwargs):
|
||||
return _sync(pack)
|
||||
# push it
|
||||
enqueue_id = broker.enqueue(pack)
|
||||
logger.info(f"Enqueued {enqueue_id}")
|
||||
logger.info(f"Enqueued [{broker.list_key}] {enqueue_id}")
|
||||
logger.debug(f"Pushed {tag}")
|
||||
return task.id
|
||||
|
||||
@@ -265,6 +266,7 @@ def fetch_cached(task_id, wait=0, broker=None):
|
||||
hook=task.hook,
|
||||
args=task.args,
|
||||
kwargs=task.kwargs,
|
||||
cluster=task.get("cluster"),
|
||||
started=task.started_at,
|
||||
stopped=task.finished_at,
|
||||
result=task.result,
|
||||
@@ -335,6 +337,7 @@ def fetch_group_cached(group_id, failures=True, wait=0, count=None, broker=None)
|
||||
hook=task.hook,
|
||||
args=task.args,
|
||||
kwargs=task.kwargs,
|
||||
cluster=task.get("cluster"),
|
||||
started=task.started_at,
|
||||
stopped=task.finished_at,
|
||||
result=task.result,
|
||||
|
||||
Reference in New Issue
Block a user