mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Cache returned letter summary in Redis
We’re going to start using the returned letters summary to show some info on the dashboard. This means we will be accessing it more often than it changes. And we know exactly when it changes because it’s us manually submitting the references we get from DVLA. This makes it a good candidate for being cached, and Redis is where we cache stuff that we’d otherwise go to the API for.
This commit is contained in:
@@ -569,6 +569,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
def get_service_data_retention(self, service_id):
|
||||
return self.get("/service/{}/data-retention".format(service_id))
|
||||
|
||||
@cache.set('service-{service_id}-returned-letters-summary')
|
||||
def get_returned_letter_summary(self, service_id):
|
||||
return self.get("service/{}/returned-letter-summary".format(service_id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user