You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reducing the number of queries against our data is necessary to maintain a stable product. Template History should be cached in local memory.
Ticket is understood, and QA has been contacted (if the ticket has a QA label).
User Story(ies)
As a VA Notify reliability dev I want to reduce unnecessary DB calls So that our db is only used when necessary
Additional Info and Resources
send_email_to_provider and send_sms_to_provider call dao_get_template_by_id, passing notification.template_version. New versions are created for every edit, so this is 100% something that should be cached, as any update would be a new version, and would update the cache.
Acceptance Criteria
Uses a dataclass for the necessary fields
Takes the input data (id, version) and returns a TemplateDataDict dataclass
User Story - Business Need
Reducing the number of queries against our data is necessary to maintain a stable product. Template History should be cached in local memory.
User Story(ies)
As a VA Notify reliability dev
I want to reduce unnecessary DB calls
So that our db is only used when necessary
Additional Info and Resources
send_email_to_provider
andsend_sms_to_provider
calldao_get_template_by_id
, passingnotification.template_version
. New versions are created for every edit, so this is 100% something that should be cached, as any update would be a new version, and would update the cache.Acceptance Criteria
TemplateDataDict
dataclass@cached(cache=TTLCache(maxsize=1024, ttl=600))
QA Considerations
Should be no difference for end-users.
Potential Dependencies
The text was updated successfully, but these errors were encountered: