Skip to content

Commit

Permalink
feature: adding delay to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJaeger committed Oct 14, 2024
1 parent 02a6935 commit 110b5a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chats/apps/api/v1/rooms/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def close(

except DatabaseError as error:
if attempt < settings.MAX_RETRIES - 1:
time.sleep(settings.RETRY_DELAY_SECONDS)
delay = settings.RETRY_DELAY_SECONDS * (2**attempt)
time.sleep(delay)
continue
else:
return Response(
Expand Down

0 comments on commit 110b5a7

Please sign in to comment.