mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-07 03:43:48 -05:00
`_get_current_service` is a function which gets called every time `current_service` is referenced in a view method or Jinja template. Because the service model was getting initialised inside this function it was being reconstructed many times in one request. On the service settings page, for example, it was getting initialised 43 times, adding about 200ms to the response time. This commit moves its initialisation to the point where we’re getting the data from the API, which only happens once per request.