mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 13:08:11 +08:00
Renames async/enqueue to async_task.
This commit is contained in:
+4
-4
@@ -407,7 +407,7 @@ def save_task(task, broker):
|
||||
return
|
||||
# enqueues next in a chain
|
||||
if task.get('chain', None):
|
||||
tasks.enqueue_chain(task['chain'], group=task['group'], cached=task['cached'], sync=task['sync'], broker=broker)
|
||||
tasks.async_chain(task['chain'], group=task['group'], cached=task['cached'], sync=task['sync'], broker=broker)
|
||||
# SAVE LIMIT > 0: Prune database, SAVE_LIMIT 0: No pruning
|
||||
db.close_old_connections()
|
||||
try:
|
||||
@@ -473,9 +473,9 @@ def save_cached(task, broker):
|
||||
# save the group list
|
||||
group_list.append(task_key)
|
||||
broker.cache.set(group_key, group_list, timeout)
|
||||
# enqueue next in a chain
|
||||
# async_task next in a chain
|
||||
if task.get('chain', None):
|
||||
tasks.enqueue_chain(task['chain'], group=group, cached=task['cached'], sync=task['sync'], broker=broker)
|
||||
tasks.async_chain(task['chain'], group=group, cached=task['cached'], sync=task['sync'], broker=broker)
|
||||
# save the task
|
||||
broker.cache.set(task_key,
|
||||
SignedPackage.dumps(task),
|
||||
@@ -536,7 +536,7 @@ def scheduler(broker=None):
|
||||
q_options['broker'] = broker
|
||||
q_options['group'] = q_options.get('group', s.name or s.id)
|
||||
kwargs['q_options'] = q_options
|
||||
s.task = tasks.enqueue(s.func, *args, **kwargs)
|
||||
s.task = tasks.async_task(s.func, *args, **kwargs)
|
||||
# log it
|
||||
if not s.task:
|
||||
logger.error(
|
||||
|
||||
Reference in New Issue
Block a user