@@ -89,7 +89,6 @@ def abort_task(task_context: TaskContext, task_uuid: TaskUUID) -> None:
8989 task_id = build_task_id (task_context , task_uuid )
9090 AbortableAsyncResult (task_id ).abort ()
9191
92- @make_async ()
9392 async def get_task_result (
9493 self , task_context : TaskContext , task_uuid : TaskUUID
9594 ) -> Any :
@@ -129,12 +128,12 @@ def _get_progress_report(
129128 actual_value = _MIN_PROGRESS_VALUE , total = _MAX_PROGRESS_VALUE
130129 )
131130
131+ @make_async ()
132132 def _get_state (self , task_context : TaskContext , task_uuid : TaskUUID ) -> TaskState :
133133 task_id = build_task_id (task_context , task_uuid )
134134 return _CELERY_STATES_MAPPING [self ._celery_app .AsyncResult (task_id ).state ]
135135
136- @make_async ()
137- def get_task_status (
136+ async def get_task_status (
138137 self , task_context : TaskContext , task_uuid : TaskUUID
139138 ) -> TaskStatus :
140139 with log_context (
@@ -144,7 +143,7 @@ def get_task_status(
144143 ):
145144 return TaskStatus (
146145 task_uuid = task_uuid ,
147- task_state = self ._get_state (task_context , task_uuid ),
146+ task_state = await self ._get_state (task_context , task_uuid ),
148147 progress_report = self ._get_progress_report (task_context , task_uuid ),
149148 )
150149
0 commit comments