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. Provider details are not something that changes very often and can safely be cached.
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
client_to_use calls get_provider which seems to contain the offending method get_provider_details_by_id. The code can instead call a processing/caching method that makes that same call but translates the ORM object into a dataclass, so we don't have to keep looking up database "constants".
When it returns from get_provider it calls get_client_by_name_and_type, which looks up which initialized provider to use, so it appears no additional work needs to be done outside of "wrapping" the DAO method.
User Story - Business Need
Reducing the number of queries against our data is necessary to maintain a stable product. Provider details are not something that changes very often and can safely be cached.
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
client_to_use
callsget_provider
which seems to contain the offending methodget_provider_details_by_id
. The code can instead call a processing/caching method that makes that same call but translates the ORM object into a dataclass, so we don't have to keep looking up database "constants".When it returns from
get_provider
it callsget_client_by_name_and_type
, which looks up which initialized provider to use, so it appears no additional work needs to be done outside of "wrapping" the DAO method.Acceptance Criteria
@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: