From e84be5f33b7a5f37d0ed3233eddaf8a1036f4b4e Mon Sep 17 00:00:00 2001 From: Matthew Swabey Date: Sun, 9 Dec 2018 12:28:04 -0500 Subject: [PATCH] Modified django_q imports to support Python 3.4 again in cluster.py. Closes #315 --- django_q/cluster.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django_q/cluster.py b/django_q/cluster.py index dc1b46c..50e4068 100644 --- a/django_q/cluster.py +++ b/django_q/cluster.py @@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _ from multiprocessing import Event, Process, Value, current_process # Local -from django_q import tasks +import django_q.tasks from django_q.brokers import get_broker from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter from django_q.models import Task, Success, Schedule @@ -402,7 +402,7 @@ def save_task(task, broker): return # enqueues next in a chain if task.get('chain', None): - tasks.async_chain(task['chain'], group=task['group'], cached=task['cached'], sync=task['sync'], broker=broker) + django_q.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: @@ -470,7 +470,7 @@ def save_cached(task, broker): broker.cache.set(group_key, group_list, timeout) # async_task next in a chain if task.get('chain', None): - tasks.async_chain(task['chain'], group=group, cached=task['cached'], sync=task['sync'], broker=broker) + django_q.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), @@ -531,7 +531,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.async_task(s.func, *args, **kwargs) + s.task = django_q.tasks.async_task(s.func, *args, **kwargs) # log it if not s.task: logger.error(