mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-14 23:07:49 -04:00
New queues for the sms/email tasks
Previously there were 4 queues for sending messages The was based on the fact that each notification has 2 actions - persist in the database and send to provider. Two queues supported the CSV upload - for the first of these tasks - bulk-email - build-sms And there were two more queues for the tasks that make the 3rd party client calls. - sms - email API Calls just used the latter two queues for both tasks Added four new queues - db-email - db-sms - send-sms - send-email So an API call puts a notification into the db-[type] queue first, which then puts the notification into the send-[type] queue Build queues stay as before. This will allow us to target processing of these tasks with separate workers to manage these differently.
This commit is contained in:
@@ -147,7 +147,7 @@ def send_sms(self,
|
||||
try:
|
||||
_save_notification(created_at, notification, notification_id, service_id, SMS_TYPE, api_key_id, key_type)
|
||||
|
||||
send_sms_to_provider.apply_async((service_id, notification_id), queue='sms')
|
||||
send_sms_to_provider.apply_async((service_id, notification_id), queue='send-sms')
|
||||
|
||||
current_app.logger.info(
|
||||
"SMS {} created at {}".format(notification_id, created_at)
|
||||
@@ -182,7 +182,7 @@ def send_email(self, service_id,
|
||||
try:
|
||||
_save_notification(created_at, notification, notification_id, service_id, EMAIL_TYPE, api_key_id, key_type)
|
||||
|
||||
send_email_to_provider.apply_async((service_id, notification_id), queue='email')
|
||||
send_email_to_provider.apply_async((service_id, notification_id), queue='send-email')
|
||||
|
||||
current_app.logger.info("Email {} created at {}".format(notification_id, created_at))
|
||||
except SQLAlchemyError as e:
|
||||
|
||||
Reference in New Issue
Block a user