1 parent a762315 commit 0bd625dCopy full SHA for 0bd625d
1 file changed
celery_progress/websockets/consumers.py
@@ -27,11 +27,12 @@ async def receive(self, text_data):
27
task_type = text_data_json['type']
28
29
if task_type == 'check_task_completion':
30
+ from asgiref.sync import sync_to_async
31
await self.channel_layer.group_send(
32
self.task_id,
33
{
34
'type': 'update_task_progress',
- 'data': Progress(AsyncResult(self.task_id)).get_info()
35
+ 'data': await sync_to_async(Progress(AsyncResult(self.task_id)).get_info, thread_sensitive=True)()
36
}
37
)
38
0 commit comments