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 12
12
from django .db .utils import InterfaceError
13
13
from kombu .exceptions import DecodeError
14
14
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
+ )
16
20
from ..settings import get_task_props_extension
17
21
18
22
EXCEPTIONS_TO_CATCH = (InterfaceError ,)
Original file line number Diff line number Diff line change 3
3
import json
4
4
5
5
from celery import states
6
- from celery .result import result_from_tuple
6
+ from celery .result import CeleryGroupResult , result_from_tuple
7
7
from django .conf import settings
8
8
from django .db import models
9
9
from django .utils .translation import gettext_lazy as _
10
10
11
11
from .. import managers
12
- from ..models .helpers import groupresult_model
13
12
14
13
ALL_STATES = sorted (states .ALL_STATES )
15
14
TASK_STATE_CHOICES = sorted (zip (ALL_STATES , ALL_STATES ))
@@ -175,7 +174,7 @@ def group_result(self, app=None):
175
174
app (Celery): app instance to create the GroupResult with.
176
175
177
176
"""
178
- return groupresult_model () (
177
+ return CeleryGroupResult (
179
178
self .group_id ,
180
179
[result_from_tuple (r , app = app )
181
180
for r in json .loads (self .sub_tasks )],
Original file line number Diff line number Diff line change 2
2
from django .conf import settings
3
3
from django .core .exceptions import ImproperlyConfigured
4
4
5
+ from .generic import ChordCounter , GroupResult , TaskResult
6
+
5
7
6
8
def taskresult_model ():
7
9
"""Return the TaskResult model that is active in this project."""
8
10
if not hasattr (settings , 'CELERY_RESULTS_TASKRESULT_MODEL' ):
9
- from .generic import TaskResult
10
-
11
11
return TaskResult
12
12
13
13
try :
@@ -31,8 +31,6 @@ def chordcounter_model():
31
31
"""Return the ChordCounter model that is active in this project."""
32
32
33
33
if not hasattr (settings , 'CELERY_RESULTS_CHORDCOUNTER_MODEL' ):
34
- from .generic import ChordCounter
35
-
36
34
return ChordCounter
37
35
38
36
try :
@@ -55,8 +53,6 @@ def chordcounter_model():
55
53
def groupresult_model ():
56
54
"""Return the GroupResult model that is active in this project."""
57
55
if not hasattr (settings , 'CELERY_RESULTS_GROUPRESULT_MODEL' ):
58
- from .generic import GroupResult
59
-
60
56
return GroupResult
61
57
62
58
try :
You can’t perform that action at this time.
0 commit comments