oncall-engine/engine/apps/slack/models
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
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_action_record.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_channel.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_message.py Send a Slack DM when user is not in channel (#1144) 2023-01-18 16:08:15 +00:00
slack_team_identity.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
slack_user_identity.py Send a Slack DM when user is not in channel (#1144) 2023-01-18 16:08:15 +00:00
slack_usergroup.py optimize GET /schedules internal API endpoint (#1169) 2023-01-25 11:08:09 +01:00