Skip to content

Commit

Permalink
fix: retry interval
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Jan 10, 2024
1 parent 85f6919 commit 3c16443
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def make_phone_call(self, campaign_id: str, contact_id: str, account_id: str):
campaign = campaign_res.json()
retry_interval = campaign.get("retry_interval", 15)

retry_interval_in_seconds = retry_interval * 60

working_hours_start = datetime.strptime(
campaign.get("working_hours_start"), "%H:%M"
).time()
Expand Down Expand Up @@ -226,7 +228,7 @@ def make_phone_call(self, campaign_id: str, contact_id: str, account_id: str):

if status is not None:
if status in ["Busy", "No Answer", "Failed"]:
self.retry(countdown=retry_interval)
self.retry(countdown=retry_interval_in_seconds)
else:
break

Expand Down

0 comments on commit 3c16443

Please sign in to comment.