Files
notifications-admin/app/notify_client/status_api_client.py
Chris Hill-Scott 9863aa3c48 Automate counting of live services and orgs
Returns the data calculated by the API. Stored in Redis against a
hardcoded key so that no-one hammering the home page is directly hitting
the database.
2019-04-12 13:59:33 +01:00

15 lines
423 B
Python

from app.notify_client import NotifyAdminAPIClient, cache
class StatusApiClient(NotifyAdminAPIClient):
def get_status(self, *params):
return self.get(url='/_status', *params)
@cache.set('live-service-and-organisation-counts')
def get_count_of_live_services_and_organisations(self):
return self.get(url='/_status/live-service-and-organisation-counts')
status_api_client = StatusApiClient()