mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-26 11:38:32 -04:00
Commit the db session before sending notification to the queue.
When a high volume service posts a notification we want to commit the db session before we send the message to SQS. This will release the db connection earlier.
This commit is contained in:
@@ -1006,11 +1006,14 @@ def test_post_notifications_saves_email_normally_if_save_email_to_queue_fails(cl
|
||||
"template_id": template.id,
|
||||
"personalisation": {"message": "Dear citizen, have a nice day"}
|
||||
}
|
||||
|
||||
print("******** Start")
|
||||
response = client.post(
|
||||
path='/v2/notifications/email',
|
||||
data=json.dumps(data),
|
||||
headers=[('Content-Type', 'application/json'), create_authorization_header(service_id=service.id)]
|
||||
)
|
||||
print("********** End")
|
||||
|
||||
json_resp = response.get_json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user