Skip to content

Commit

Permalink
Merge pull request #47 from QRTaxi/yj
Browse files Browse the repository at this point in the history
refactor: status cancel 오류수정
  • Loading branch information
ChoiYoo authored Aug 17, 2023
2 parents 2956a51 + 079ce4d commit 99e97f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion call/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def assign_driver_to_request(assign_id, qr_id):

if retry_count == max_retries:
get_assign_info = Assign.objects.get(id=assign_id)
if get_assign_info.status == "cancel":
return "Assign already canceled"
get_assign_info.status = 'failed'
get_assign_info.save(update_fields=['status'])
return "Not accepted"
Expand Down Expand Up @@ -100,6 +102,6 @@ def assign_driver_to_request(assign_id, qr_id):
elif result:
return "Accepted"
time.sleep(1)

redis_conn.lpop(key)
redis_conn.sadd(f"assign_set_{assign_id}", driver_id)

0 comments on commit 99e97f7

Please sign in to comment.