mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Use new redis key for service templates and broadcasts
We can drop use of the old key as we no longer need to read data from the old key. Either data exists in the new key and we read it from there or data doesn't exist in the new key and we go to the API to get it and then set it in redis. Note, the previous commit is important because it means we aren't at risk of when this commit is being deployed out, of us getting stale data from the old key.
This commit is contained in:
@@ -258,7 +258,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
_attach_current_user({'postage': postage})
|
||||
)
|
||||
|
||||
@cache.set('template-{template_id}-version-{version}')
|
||||
@cache.set('service-{service_id}-template-{template_id}-version-{version}')
|
||||
def get_service_template(self, service_id, template_id, version=None):
|
||||
"""
|
||||
Retrieve a service template.
|
||||
@@ -270,7 +270,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
endpoint = '{base}/version/{version}'.format(base=endpoint, version=version)
|
||||
return self.get(endpoint)
|
||||
|
||||
@cache.set('template-{template_id}-versions')
|
||||
@cache.set('service-{service_id}-template-{template_id}-versions')
|
||||
def get_service_template_versions(self, service_id, template_id):
|
||||
"""
|
||||
Retrieve a list of versions for a template
|
||||
|
||||
Reference in New Issue
Block a user