Skip to content

Commit 692473c

Browse files
committed
update sync_to_async to database_sync_to_async (https://channels.readthedocs.io/en/stable/topics/databases.html)
1 parent 0bd625d commit 692473c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

celery_progress/websockets/consumers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ async def receive(self, text_data):
2727
task_type = text_data_json['type']
2828

2929
if task_type == 'check_task_completion':
30-
from asgiref.sync import sync_to_async
30+
from channels.db import database_sync_to_async
3131
await self.channel_layer.group_send(
3232
self.task_id,
3333
{
3434
'type': 'update_task_progress',
35-
'data': await sync_to_async(Progress(AsyncResult(self.task_id)).get_info, thread_sensitive=True)()
35+
'data': await database_sync_to_async(Progress(AsyncResult(self.task_id)).get_info)()
3636
}
3737
)
3838

0 commit comments

Comments
 (0)