Skip to content

Commit

Permalink
Hotfix support for django_db for celery backend (specially for django…
Browse files Browse the repository at this point in the history
…_celery_results)
  • Loading branch information
aidin-leo committed Jan 8, 2021
1 parent a762315 commit f4d6e97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion celery_progress/websockets/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ 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
progress = Progress(AsyncResult(self.task_id))
await self.channel_layer.group_send(
self.task_id,
{
'type': 'update_task_progress',
'data': Progress(AsyncResult(self.task_id)).get_info()
'data': await sync_to_async(progress.get_info, thread_sensitive=True)()
}
)

Expand Down

0 comments on commit f4d6e97

Please sign in to comment.