webkom / lego

Backend for abakus.no
https://lego.abakus.no
MIT License
55 stars 20 forks source link

Make ical feed generation of meetings not slow #3321

Closed LudvigHz closed 1 year ago

LudvigHz commented 1 year ago

The lookup for participating was very expensive and slow. It would cause timeouts so some users' calendars would not load.

UNTESTED

~~This is my theory at least. I just wrote this code and haven't had the time to test it. But events does not suffer from this problem so I hope my suspicions are correct.~~

Tested the code in staging with a hotpatch. Works great now :)

Fixes ABA-448

LudvigHz commented 1 year ago

Sorry about the noise in the diff. I also fixed some types here and there when I was working :))

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 96.77% and no project coverage change.

Comparison is base (a6f64c3) 88.34% compared to head (16c3fdb) 88.34%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3321 +/- ## ======================================= Coverage 88.34% 88.34% ======================================= Files 661 661 Lines 20938 20949 +11 ======================================= + Hits 18498 18508 +10 - Misses 2440 2441 +1 ``` | [Impacted Files](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom) | Coverage Δ | | |---|---|---| | [lego/apps/ical/utils.py](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom#diff-bGVnby9hcHBzL2ljYWwvdXRpbHMucHk=) | `100.00% <ø> (ø)` | | | [lego/apps/permissions/permissions.py](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom#diff-bGVnby9hcHBzL3Blcm1pc3Npb25zL3Blcm1pc3Npb25zLnB5) | `90.16% <94.73%> (-0.36%)` | :arrow_down: | | [lego/apps/events/permissions.py](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom#diff-bGVnby9hcHBzL2V2ZW50cy9wZXJtaXNzaW9ucy5weQ==) | `97.77% <100.00%> (ø)` | | | [lego/apps/ical/viewsets.py](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom#diff-bGVnby9hcHBzL2ljYWwvdmlld3NldHMucHk=) | `100.00% <100.00%> (ø)` | | | [lego/apps/permissions/utils.py](https://codecov.io/gh/webkom/lego/pull/3321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom#diff-bGVnby9hcHBzL3Blcm1pc3Npb25zL3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webkom)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

linear[bot] commented 1 year ago
ABA-448 Fix slow ical feed generation breaking calendar sync

It has broken the calendar sync for many people