Merge branch 'master' into refactor

This commit is contained in:
Stan Triepels
2023-04-11 15:04:25 +02:00
committed by GitHub
24 changed files with 525 additions and 359 deletions
+5 -2
View File
@@ -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,