diff --git a/apps/users/tasks.py b/apps/users/tasks.py index a13c2f5..a82f7d3 100644 --- a/apps/users/tasks.py +++ b/apps/users/tasks.py @@ -20,5 +20,9 @@ def send_notification(phone_number=None, 'phone_number': phone_number, "body": f'{title}:\n{body}' } - print(client.request(required_scopes=SCOPES, url=f'{settings.BASE_NOTIFICATION_URL}/notifications/', data=data, - method='post').text) + try: + print(client.request(required_scopes=SCOPES, url=f'{settings.BASE_NOTIFICATION_URL}/notifications/', data=data, + method='post', timeout=5).text) + except Exception as e: + print(e) +