-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TwilioPhoneProvider optimizations #2034
Conversation
status_code = TwilioCallStatuses.DETERMINANT.get(call_status) | ||
|
||
if status_code is None: | ||
logger.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how normal is receiving unexpected status? This code won't alert us if we start receiving unexpected statuses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok, status is only needed for better timeline. The thing about checking status always was in twilio part, so I decided to at least log it
@@ -61,12 +61,10 @@ def _calculate_phone_notifications_left(self, user): | |||
day_start = now.replace(hour=0, minute=0, second=0, microsecond=0) | |||
calls_today = PhoneCallRecord.objects.filter( | |||
created_at__gte=day_start, | |||
represents_alert_group__channel__organization=self.organization, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we remove it because user can be a member of single organization and organization filter is excess, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right
What this PR does
This PR does three improvements in twilio_phone_provider: