File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 22from abc import ABCMeta , abstractmethod
33from decimal import Decimal
44
5- from celery . result import EagerResult , allow_join_result
5+ from asgiref . sync import sync_to_async
66from celery .backends .base import DisabledBackend
7-
7+ from celery . result import EagerResult , allow_join_result
88
99PROGRESS_STATE = 'PROGRESS'
1010
@@ -57,6 +57,7 @@ def __init__(self, result):
5757 """
5858 self .result = result
5959
60+ @sync_to_async
6061 def get_info (self ):
6162 response = {'state' : self .result .state }
6263 if self .result .state in ['SUCCESS' , 'FAILURE' ]:
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ async def receive(self, text_data):
3131 self .task_id ,
3232 {
3333 'type' : 'update_task_progress' ,
34- 'data' : Progress (AsyncResult (self .task_id )).get_info ()
34+ 'data' : await Progress (AsyncResult (self .task_id )).get_info ()
3535 }
3636 )
3737
You can’t perform that action at this time.
0 commit comments