File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1212from django .db .utils import InterfaceError
1313from kombu .exceptions import DecodeError
1414
15- from ..models .helpers import chordcounter_model , groupresult_model , taskresult_model
15+ from ..models .helpers import (
16+ chordcounter_model ,
17+ groupresult_model ,
18+ taskresult_model ,
19+ )
1620from ..settings import get_task_props_extension
1721
1822EXCEPTIONS_TO_CATCH = (InterfaceError ,)
Original file line number Diff line number Diff line change 33import json
44
55from celery import states
6- from celery .result import result_from_tuple
6+ from celery .result import CeleryGroupResult , result_from_tuple
77from django .conf import settings
88from django .db import models
99from django .utils .translation import gettext_lazy as _
1010
1111from .. import managers
12- from ..models .helpers import groupresult_model
1312
1413ALL_STATES = sorted (states .ALL_STATES )
1514TASK_STATE_CHOICES = sorted (zip (ALL_STATES , ALL_STATES ))
@@ -175,7 +174,7 @@ def group_result(self, app=None):
175174 app (Celery): app instance to create the GroupResult with.
176175
177176 """
178- return groupresult_model () (
177+ return CeleryGroupResult (
179178 self .group_id ,
180179 [result_from_tuple (r , app = app )
181180 for r in json .loads (self .sub_tasks )],
Original file line number Diff line number Diff line change 22from django .conf import settings
33from django .core .exceptions import ImproperlyConfigured
44
5+ from .generic import ChordCounter , GroupResult , TaskResult
6+
57
68def taskresult_model ():
79 """Return the TaskResult model that is active in this project."""
810 if not hasattr (settings , 'CELERY_RESULTS_TASKRESULT_MODEL' ):
9- from .generic import TaskResult
10-
1111 return TaskResult
1212
1313 try :
@@ -31,8 +31,6 @@ def chordcounter_model():
3131 """Return the ChordCounter model that is active in this project."""
3232
3333 if not hasattr (settings , 'CELERY_RESULTS_CHORDCOUNTER_MODEL' ):
34- from .generic import ChordCounter
35-
3634 return ChordCounter
3735
3836 try :
@@ -55,8 +53,6 @@ def chordcounter_model():
5553def groupresult_model ():
5654 """Return the GroupResult model that is active in this project."""
5755 if not hasattr (settings , 'CELERY_RESULTS_GROUPRESULT_MODEL' ):
58- from .generic import GroupResult
59-
6056 return GroupResult
6157
6258 try :
You can’t perform that action at this time.
0 commit comments