oncall-engine/engine/apps
Joey Orlando 3cf2fcf660
optimize GET /schedules internal API endpoint (#1169)
# What this PR does

Fixes slow internal`GET /schedules` endpoints. Using the fake-data
generation script in #1128, I generated 65 calendar schedules in my
local setup. This resulted in the following endpoint performance:
![Screenshot 2023-01-24 at 12 03
16](https://user-images.githubusercontent.com/9406895/214276618-1a9848ba-eb84-49ec-a099-fdd96beac93f.png)

The responses which show ~76 queries were run on the latest `dev`
branch. Responses w/ ~26 queries were run on this branch.

Additionally:
- add typing to a few methods in `apps/schedules/ical_utils.py`
- document `apps/api/permissions/__init__.py:user_is_authorized`
function

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/1552

## Checklist

- [ ] Tests updated
- [ ] Documentation added
- [ ] `CHANGELOG.md` updated

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2023-01-25 11:08:09 +01:00
..
alerts Refactor create/update contact points for Alerting integration (#872) 2023-01-25 09:42:42 +01:00
api optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
api_for_grafana_incident World, meet OnCall! 2022-06-03 08:09:47 -06:00
auth_token Refactor plugin sync (#1200) 2023-01-25 09:12:08 +08:00
base Allow messaging backends to be enabled/disabled per organization (#1151) 2023-01-18 15:52:25 +00:00
email Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
grafana_plugin Refactor plugin sync (#1200) 2023-01-25 09:12:08 +08:00
heartbeat Insight logs (#348) 2022-08-24 12:04:44 +05:00
integrations Add escalation chain option when creating a direct page alert group (#1143) 2023-01-18 12:58:26 -03:00
mobile_app Remove DynamicSetting usage for mobile app backend on OSS (#1204) 2023-01-24 13:53:54 +00:00
oss_installation Allow viewers fetch cloud connection status (#1181) 2023-01-23 11:17:57 +00:00
public_api Sync users and teams on tf requests (#1180) 2023-01-24 13:44:07 +08:00
schedules optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
slack optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00
social_auth Support of oncall-gw (#741) 2022-11-08 14:43:22 +08:00
telegram remove send_link_to_channel_message_or_fallback_to_full_incident 2023-01-06 11:34:11 +00:00
twilioapp Add simple check if using API key instead of AUTH token 2022-11-09 21:52:42 -07:00
user_management Sync users and teams on tf requests (#1180) 2023-01-24 13:44:07 +08:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00