Send complaints on to service callback APIs using an async task

This commit is contained in:
Pea Tyczynska
2018-07-18 17:03:16 +01:00
parent 946e0b2700
commit 812f4d20dd
9 changed files with 199 additions and 59 deletions

View File

@@ -16,7 +16,7 @@ from app import performance_platform_client, zendesk_client
from app.aws import s3
from app.celery.service_callback_tasks import (
send_delivery_status_to_service,
create_encrypted_callback_data,
create_delivery_status_callback_data,
)
from app.celery.tasks import process_job
from app.config import QueueNames, TaskNames
@@ -212,7 +212,7 @@ def timeout_notifications():
# queue callback task only if the service_callback_api exists
service_callback_api = get_service_delivery_status_callback_api_for_service(service_id=notification.service_id)
if service_callback_api:
encrypted_notification = create_encrypted_callback_data(notification, service_callback_api)
encrypted_notification = create_delivery_status_callback_data(notification, service_callback_api)
send_delivery_status_to_service.apply_async([str(notification.id), encrypted_notification],
queue=QueueNames.CALLBACKS)