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