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:
Martyn Inglis
2016-08-30 10:42:24 +01:00
parent 58a89a3a80
commit 486697d07c
5 changed files with 20 additions and 16 deletions

View File

@@ -299,7 +299,7 @@ def send_notification(notification_type):
'api_key_id': str(api_user.id),
'key_type': api_user.key_type
},
queue='sms'
queue='db-sms'
)
else:
send_email.apply_async(
@@ -313,7 +313,7 @@ def send_notification(notification_type):
'api_key_id': str(api_user.id),
'key_type': api_user.key_type
},
queue='email'
queue='db-email'
)
return jsonify(