mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Use cache for tasks that save notifications
These tasks need to repeatedly get the same template and service from the database. We should be able to improve their performance by getting the template and service from the cache instead, like we do in the REST endpoint code.
This commit is contained in:
@@ -233,7 +233,7 @@ def test_should_cache_template_lookups_in_memory(mocker, client, sample_template
|
||||
|
||||
assert mock_get_template.call_count == 1
|
||||
assert mock_get_template.call_args_list == [
|
||||
call(service_id=str(sample_template.service_id), template_id=str(sample_template.id))
|
||||
call(service_id=str(sample_template.service_id), template_id=str(sample_template.id), version=None)
|
||||
]
|
||||
assert Notification.query.count() == 5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user