diff --git a/celery_progress/websockets/consumers.py b/celery_progress/websockets/consumers.py index 5b3dcd3..44845a6 100644 --- a/celery_progress/websockets/consumers.py +++ b/celery_progress/websockets/consumers.py @@ -27,11 +27,12 @@ async def receive(self, text_data): task_type = text_data_json['type'] if task_type == 'check_task_completion': + from channels.db import database_sync_to_async await self.channel_layer.group_send( self.task_id, { 'type': 'update_task_progress', - 'data': Progress(AsyncResult(self.task_id)).get_info() + 'data': await database_sync_to_async(Progress(AsyncResult(self.task_id)).get_info)() } )