[Answered ]-How make django sleep

1๐Ÿ‘

I used Celery to solve the problem
I used apply_async and countdown to solve the problem this way

I created a celery task and inside a for loop I used apply_async with countdown

for idx,lawyer in enumerate(lawyers):
    if(consultation.lawyer):
        break      
    change_offered_lawyer.apply_async((id,lawyer.id),countdown=idx*60)

this way each time based on the count of idx the view will wait and then will call the task

๐Ÿ‘คHamedio

Leave a comment