use callback queue

This commit is contained in:
venusbb
2017-12-13 11:55:08 +00:00
parent 11152ab117
commit cef8d6e294
8 changed files with 12 additions and 11 deletions

View File

@@ -199,7 +199,7 @@ def timeout_notifications():
service_callback_api = get_service_callback_api_for_service(service_id=notification.service_id)
if service_callback_api:
send_delivery_status_to_service.apply_async([str(id)], queue=QueueNames.NOTIFY)
send_delivery_status_to_service.apply_async([str(id)], queue=QueueNames.CALLBACKS)
current_app.logger.info(
"Timeout period reached for {} notifications, status has been updated.".format(len(notifications)))

View File

@@ -416,7 +416,7 @@ def update_letter_notifications_to_error(self, notification_references):
service_callback_api = get_service_callback_api_for_service(service_id=notifications[0].service_id)
if service_callback_api:
for notification in notifications:
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.NOTIFY)
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.CALLBACKS)
def create_dvla_file_contents_for_job(job_id):
@@ -503,7 +503,7 @@ def update_letter_notifications_statuses(self, filename):
service_callback_api = get_service_callback_api_for_service(service_id=notifications[0].service_id)
if service_callback_api:
for notification in notifications:
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.NOTIFY)
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.CALLBACKS)
def process_updates_from_file(response_file):

View File

@@ -99,4 +99,4 @@ def _check_and_queue_callback_task(notification_id, service_id):
# queue callback task only if the service_callback_api exists
service_callback_api = get_service_callback_api_for_service(service_id=service_id)
if service_callback_api:
send_delivery_status_to_service.apply_async([str(notification_id)], queue=QueueNames.NOTIFY)
send_delivery_status_to_service.apply_async([str(notification_id)], queue=QueueNames.CALLBACKS)

View File

@@ -89,7 +89,7 @@ def process_sms_client_response(status, reference, client_name):
service_callback_api = get_service_callback_api_for_service(service_id=notification.service_id)
if service_callback_api:
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.NOTIFY)
send_delivery_status_to_service.apply_async([str(notification.id)], queue=QueueNames.CALLBACKS)
success = "{} callback succeeded. reference {} updated".format(client_name, reference)
return success, errors