Files
notifications-api/lambda_function
Martyn Inglis 897ad6a957 prevent race conditions in run_scheduled_jobs queuing jobs multiple times
we were running into issues where multiple beats queue up the
run_scheduled_jobs task at the same time, and concurrency issues with selecting
scheduled jobs causes both tasks to trigger processing of the job.

Use with_for_update, which calls through to the postgres SELECT  ... FOR UPDATE
which locks other SELECT FOR UPDATES (ie other threads running same code) until
the rows are set to pending and the transaction completes - so the second
thread will not find any rows
2016-10-07 12:35:02 +01:00
..

Lambda function

This code is used to setup a lambda function to call into our API to deliver messages.

Basic expected flow is that an request to GOV.UK Notify to send a text/email will persist in our DB then invoke an async lambda function.

This function will call /deliver/notification/{id} which will make the API call to our delivery partners, updating the DB with the response.

EXPERIMENTAL AT THIS STAGE