Merge pull request #4077 from alphagov/reduce-redis-cache-ttl

Reduce impact of bug with performance page caching stale data
This commit is contained in:
David McDonald
2021-12-08 16:22:34 +00:00
committed by GitHub
7 changed files with 73 additions and 24 deletions

View File

@@ -103,7 +103,7 @@ class JobApiClient(NotifyAdminAPIClient):
redis_client.set(
'has_jobs-{}'.format(service_id),
b'true',
ex=cache.TTL,
ex=cache.DEFAULT_TTL,
)
return job

View File

@@ -3,7 +3,7 @@ from app.notify_client import NotifyAdminAPIClient, cache
class PerformanceDashboardAPIClient(NotifyAdminAPIClient):
@cache.set('performance-stats-{start_date}-to-{end_date}')
@cache.set('performance-stats-{start_date}-to-{end_date}', ttl_in_seconds=3600)
def get_performance_dashboard_stats(
self,
*,

View File

@@ -6,7 +6,7 @@ class StatusApiClient(NotifyAdminAPIClient):
def get_status(self, *params):
return self.get(url='/_status', *params)
@cache.set('live-service-and-organisation-counts')
@cache.set('live-service-and-organisation-counts', ttl_in_seconds=3600)
def get_count_of_live_services_and_organisations(self):
return self.get(url='/_status/live-service-and-organisation-counts')