mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Improve the performance of the query to get the last template usage.
By adding the service id, the query performance has improved greatly. It went from 6200ms to 0.04ms. This should stop the 500s when a template is deleted.
This commit is contained in:
@@ -47,7 +47,7 @@ def get_template_statistics_for_template_id(service_id, template_id):
|
||||
template = dao_get_template_by_id_and_service_id(template_id, service_id)
|
||||
|
||||
data = None
|
||||
notification = dao_get_last_template_usage(template_id, template.template_type)
|
||||
notification = dao_get_last_template_usage(template_id, template.template_type, template.service_id)
|
||||
if notification:
|
||||
data = notification_with_template_schema.dump(notification).data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user